LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use DLL written in CVI 2013 in Visual C++

using , #import "mydevice.dll" in VisualC++  ,

I get "Error loading type library/DLL"

I built the DLL & LIB files in CVI 2013 , how do I use them in visual C++

0 Kudos
Message 1 of 3
(4,517 Views)

Hello,

 

My first instinct is that your project cannot find the DLL. According to this page on MSDN: Search Path Used by Windows to Locate a DLL

Windows will look in the following locations for your DLL:

  1. The directory where the executable module for the current process is located.
  2. The current directory.
  3. The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
  4. The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
  5. The directories listed in the PATH environment variable.

If your DLL is not in one of these locations, you have two options:

  1. Move the DLL to one of the locations listed above
  2. Use: #import "<filepath>\mydevice.dll" For example: #import "C:\Testing\Myproject.dll"

Hope that helps,

Taylor B.
National Instruments
0 Kudos
Message 2 of 3
(4,485 Views)

Hello again,

 

If that doesn't solve your problem, one other thing you can check is that the Target Settings for your DLL specify a type library:

 

DLLTargetSettings.png

 

TypeLibDLL.JPG

Taylor B.
National Instruments
0 Kudos
Message 3 of 3
(4,479 Views)