My VI Works Fine but My Application(Exe) Crashes When Using ActiveX or Call Library Function Nodes

Updated Jul 23, 2019

Reported In

Software

  • LabVIEW
  • LabVIEW Application Builder Module

Operating System

  • Windows

Issue Details

My program uses Call Library Function Nodes or ActiveX calls and runs as expected in the LabVIEW Development Environment. When I try to run my program as an executable, I receive the next error:



​How do I resolve this?

Solution

To mitigate this behavior, you might need to change the file path to the DLL or ActiveX object you are calling.

 For example, if you're calling User32.dll, the file path will normally be:

C:\Windows\System32\user32.dll
 

This must be manually changed to:

%windir%\System32\user32.dll

Or, you can use only the name of the DLL without specifying the whole path:
user32.dll

Using %windir% directory constant allows the DLLs and ActiveX objects to be accessed when running the application as an executable, as well as when running within the LabVIEW Development Environment.

Also, you can use only the name of the DLL without specifying the whole path:
user32.dll

Additional Information

This error can occur for a number of reasons, including when calling external code from Windows DLLs using the Call Library Function Node.  Windows restricts access to certain domains and folders located directly on the C Drive.
Also, when you are calling system shared libraries by path, such as user32.dll, LabVIEW automatically includes the library in build specifications, then you might distribute a system shared library to another computer inadvertently.
Redistributing some shared libraries such as user32.dll might cause the target computer to crash.

Some function nodes (Python nodes in particular) can cause this crash when wiring in a path control. This bug has been fixed in the LabVIEW 2018 f2 patch. The solution to this specific issue is to upgrade to LabVIEW 2018 f2.

WAS THIS ARTICLE HELPFUL?

Not Helpful