LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong Path when building a DLL Wrapper

Solved!
Go to solution

I used the Import DLL wizard to build the wrapper scripts for accessing a DLL.  As part of the configuration process, the Library Name or Path value was entered as C:\Autani\TrkSysMySQL.dll.  The box for creating a copy of the library file was also checked.  When I went to use the VIs to call the DLL functions, the Library Node in the function was pointing to the C:\...\user.lib\ directory, where the copy of the DLL was kept.

 

First, why was this value changed from the value I entered in the wizard?  (The attached file shows the current Call Library Function setting)

Second, how will this impact building the EXE?  The actual location of the DLL is the C:\Autani directory on the target computer.

 

Thank you!

0 Kudos
Message 1 of 4
(2,502 Views)
Solution
Accepted by topic author DLJ

Try to specify a path on block diagram, if you want an absolute path; that may help.  You can make the path dependent on whether you have an exe or the IDE.

 

mcduff

 

Snap7.png

Message 2 of 4
(2,491 Views)
Solution
Accepted by topic author DLJ

You specified that you want the DLL to be copied and that is what the wizard did, and it also accordingly updated the library path to that new path. Pretty much what you asked for.

 

You can not place a DLL in an arbitrary folder and hope the system to find it on a different computer. That simply is not how DLLs are meant to work nor how LabVIEW implements it.

 

If you want to have the DLL installed independent of the LabVIEW VI library you should instead only enter the DLL name without any path or configure the Call Library Node to get the actual DLL path passed from the diagram.

 

If you configure the Call Library Node to contain the DLL name only, LabVIEW will NOT copy the DLL into a built application but assume that it is provided on the target system as a DLL installed by other means into one of the well known Windows search locations for DLLs.

 

If you really want to install it into a special path like C:\Autani you only have two options here:

 

1) Only specify the DLL name and make sure that that folder is added to the PATH environment variable.

2) change the Call Library Node to have the library path passed from the diagram and pass this specific name to it.

Rolf Kalbermatter
My Blog
Message 3 of 4
(2,483 Views)

Rolf and mcduff-

 

Thank you!

 

I have been able to find the DLL on the target computer, and now I am running down the other files that need to be listed on the Always Included section of the Build EXE  Source Files section.

0 Kudos
Message 4 of 4
(2,476 Views)