Troubleshoot LoadRunner VuGen Errors Loading Custom DLL’s

Issue: While using the lr_load_dll function, the user receives the following error:

“Action1.c(x): Error -19890 : C-interpreter run time error:
Action1.c(x): Error — File error : LoadLibrary(c:\temp\MyDll.dll) failed : The specified module could not be found.”

The error above can occur if the compiler fails to locate or load the DLL. You can check the return code of lr_load_dll to verify if this is the case.

Example code:

//---begin code---//
int x;
x = lr_load_dll("MyDLL.dll");
lr_message("return code = %d", x);
//----end code---//

If the function above returns 11, that means LoadRunner failed to find the file.

Check the following:

Double check the directory, and make sure that the DLL is in the correct path as specified in lr_load_dll function.
Make sure that all the required files are present and available to the DLL.
You can use the Windows Dependency Walker ( to check if any dependent DLL’s are not available.
Is the DLL a 16-bit DLL? If so, it is not supported.
If you are getting this error from the Controller only, make sure that you copy the DLL to the same directory of all the Load Generator machines.
If you are loading the DLL from the script’s directory, make sure that the DLL is listed in the Controller’s Design View -> Details -> More -> Files.

If you are still having problems, try to put your DLL into a path that is specified in the PATH environment variable of the machine. Modify the reference to the DLL if needed.

What's Next?

Did you enjoy this article? Help spread the word by sharing:

Join the Northway Navigator Club today and get access to restricted content including our best tips and tricks. Membership is free! You will also receive free email updates by registering.

Engage in the conversation and leave a comment:

Scott Moore

About Scott Moore (153 articles)

With over 20 years of IT experience with various platforms and technologies, Scott has tested some of the largest applications and infrastructures in the world. He is a Certified Instructor and Certified Product Consultant in HP’s LoadRunner and Performance Center products. He currently holds HP certifications for ASE, ASC, and CI. A thought leader in the APM space, he speaks regularly at IT conferences and events