LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

LoadExternalModules (return value == -4)

I am extremely new to LabWindows 2017 and was handed this program (initially created in '98 I believe) that would constantly crash when the user attempted to load a specific .lib file.

 

I recompiled the program and unchecked the Enable LoadExternalModule box in Target Settings. This fixed the program crashing for some .lib files however for the others I receive an error Function LoadExternModule: (return value ==4).

 

I've noticed that the .lib files that load correctly do not have a .h file. The ones that are unable to load have a .h file. I tried to recompile the .lib and .dll of one of these libraries however this did not work. To me this has to be a compatibility issue because this program was made so long ago. Anyone have any insight? Thanks in advance

0 Kudos
Message 1 of 2
(2,216 Views)

Error -4 means Invalid file format, but since that function is deprecated since CVI2010  I suggest you to replace LoadExternalModule with the WIN32 API LoadLibrary: see this page for reference.

As you can see in the help for the function, you can load DLLs with it but not libraries and object files.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(2,200 Views)