No Valid Handle When Using LoadLibrary Function on LabWindows/CVI™

Updated Dec 22, 2025

Reported In

Software

  • LabWindows/CVI

Issue Details

I am using the Windows SDK LoadLibrary function to dynamically load a DLL in my LabWindows/CVI application, but the function returns NULL when I check its return value.

Solution

The LoadLibrary function returns NULL when it fails and a valid module handle when it succeeds. There are several potential reasons why this issue may occur:

 

  • The DLL is 64 bits, and LabWindows/CVI build is on 32 bits. If this is the scenario, change the build of LabWindows/CVI to 64 bits.
  • The DLL is compiled on C++. If this is the scenario, the DLL needs to be compiled on C since LabWindows/CVI enviroment is C.
  •  If the system can't find the DLL or if the entry-point function returns FALSE, LoadLibrary returns NULL.