LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I import DLL from different current path?

I have created a dll ready to use for other programs. However, even I added Files in Projects (.lib), used Option/Environment to define Include Paths (where the Dll located) ... if I do not copy that Dll in the current path (where my project is) ... the CVI can not find it!
 
Why we can add Files (.lib) directly into project but can not do the same for the Dll ... or I missed some thing?
 
Thanks for any help
0 Kudos
Message 1 of 3
(3,371 Views)
HI plit string,
 
The Include Paths option found under the Options >> Environment Include dialog doesn't have anything to do with how DLLs are located. That setting only helps CVI located header files that might be needed by your application.  Windows DLLs are located by a specific algorithm which searches in the following order:
  1. The directory where the executable module for the current process is located.
  2. The current directory.
  3. The Windows system32 and system directories.
  4. The Windows directory.
  5. The directories listed in the PATH environment variable.

If the DLL is not in one of those directories, Windows can't find it.  Check out the Rules for Using DLL Files LabWindows/CVI Help topic (launch the CVI help, switch to the Index tab and type DLLs).

Hope this helps!

Best Regards, 

Jonathan N.
National Instruments
Message 2 of 3
(3,371 Views)

Hi Jonathan,

I did try the  #5. The directories listed in the PATH environment variable before I posting my request. But I did not restart the PC that time, so I thought I missing some thing (I did it again today with re-start & it works)

Anyway, your 5 guidances are very clear to me (& might be to others) so that I will not doubt again about how Window can find the dll's in the future.

Thanks Smiley Happy

0 Kudos
Message 3 of 3
(3,351 Views)