Error -2147221164 Occurring When Calling a Third Party DLL in LabVIEW

Updated Nov 29, 2023

Reported In

Software

  • LabVIEW

Issue Details

I am attempting to call a third party DLL from a LabVIEW VI, but when the reference is opened I receive the following error:

Error -2147221164 occurred at Class not registered in <VI Name>.vi


If I run the same VI with admin rights then it can successfully call the DLL.
How can I run this VI successfully without having admin rights?

Solution

This error can be seen when using a DLL that has not been registered in the operating system first. To register the DLL you can try using one of the following methods:
 
  1. Search for the Call Library Function Node located in the functions palette under Connectivity>>Libraries and Executables, as seen below:
  1. Place this function on your block diagram and double click on it. The below menu will appear:
  1. Select the small file icon next to the Library name or path box, then browse to and select the DLL you wish to register.
  2. In the Function name drop down list select the DllRegisterServer function and press OK.
  3. Save and run the VI containing this function. This will register the DLL for use and all users will be able to call it.
 
  • Registering the DLL manually.
  1. Refer to the article Register ActiveX Controls, ActiveX Servers, and Type Libraries. This includes steps to register DLLs used to communicate with third party devices via ActiveX.

This error can also appear when the code uses a third party tool or API elements and LabVIEW cannot find the modules required. Install the respective tool or API if they are missing.

Additional Information

If you run a VI that calls a DLL with admin rights, it will not require the DLL to be registered, therefore it bypasses the need to register it programmatically.