LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call library function and setting paths

Hi,
 
I tried to call a function from a third party dll. I received error that some other dll could not be found. I assumed that the dll that I am accessing is also calling other dll. all these third party dll reside in the same folder in a third party software. I did two things. 
 
1) I place my vi into the same folder as the third party dll and it works. but this is not what I like to do.
 
2) I duplicate 2 dll which was complained to be missing in the error message. that works too.
 
it seem like the call library function only search in the folder which my VI resides in and not search in the path which my dll was called.
anyway which I might be able to change this path?
 
Thanks
Goy
0 Kudos
Message 1 of 6
(3,330 Views)

Hi Goy,

You can indeed change the search paths.  In LabVIEW, just go to Tools menu and select Options...  Then select "Paths" from the pulldown menu at the top.  Here you can add additional paths to the VI Search Path list.

I hope this helps.  Let us know if you have further questions.

Megan B.
National Instruments

0 Kudos
Message 2 of 6
(3,314 Views)
However, this search path only works for DLLs directly accessed by LabVIEW. Any DLLs that are dependent fall back to the Windows search system. For example, if DLL A is called from LV, but A makes a call into DLL B, then the LV path option won't help you find B.
 
To fix this, you need to add the directory containing B to your system PATH environment variable. Note that you'll need to restart LabVIEW after doing that in order for the LV process to see the change.
 
The easiest way to do this is to go to Start->Control Panel->System. Select the Advanced tab and then environment variables.
Message 3 of 6
(3,311 Views)

Hi

Thanks Megan and LycanGeek.

The second method really works like a charm.

 

Regards

Goy

Message Edited by SG_ENGINEER on 11-22-2005 07:14 PM

0 Kudos
Message 4 of 6
(3,297 Views)
Goy,

There is another way of doing this, if you do not want to change the windows environment path varaiable. You can (at run time) use the kernel32.dll in Win2k and the
SetCurrentDirectoryA() function. If you set the current directory to the same as where your DLLs reside then all should be happy!

the function prototype is:

short int SetCurrentDirectoryA(CStr arg1);

cheers
Neil



0 Kudos
Message 5 of 6
(3,288 Views)
Hi nrp.

that seem like a good method too... I will try tomorrow in the office. Thanks too

Goy
0 Kudos
Message 6 of 6
(3,269 Views)