Error -2147221164 Occurring When Calling a Third Party DLL

Updated Aug 19, 2020

Reported In

Software

  • LabVIEW

Issue Details

I am attempting to call a third party DLL from a VI, but when the reference is opened it fails to call and 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

In order to avoid this error and to run this VI without admin rights you must register the DLL for use first. 
Please follow these steps to do this:
  1. You must use the Call Library Function Node before you attempt to open the DLL for use. This can be found in the functions palette under Connectivity>>Libaries and Executables, as seen below:
  1. Place this function on your block diagram and double click on it. The below menu will appear:
  1. Please select the small file icon next to the Library name or path box, then select the DLL you wish to register.
  2. Then 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.

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.