LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a DLL in a labview EXE file.

Hi,
When trying to open an executable of a labview program that calls a C++ DLL, the labview exe searches for the C++ DLL. When I located the C++ DLL, I get the following error:
"LabVIEW: Generic Error.
The file "myC++DLL.dll" is not a valid LabVIEW file.
Select another?"
 
Of course, I cannot select another because this is the DLL I need. When I cancel the search, the labview exe opens, but I get this msg:
"VI has an error of type 6300. The full development version of LabVIEW is required to fix the errors."
 
Even though the errors I am getting are very vague, I am wondering if this is an indication of a dependency problem (maybe the DLL needs to be in a specific location, etc. )  I am running the exe of a LabVIEW program in a computer that only has the runtime engine. I have transfered the labview exe and my C++ DLL to this new computer. I also put the C++ DLL and the exe in the same path/locations as the locations on the original computer (a computer where the full dev version exists ... where the exe was working fine (calling the C++ DLL with no errors). I am not sure if this has any effect.
 
If you have done this before, please help! This is my first time facing such issues.
 
Thanks!
0 Kudos
Message 1 of 10
(8,477 Views)
This might have something to do with the way you've build your executable (your build script). I've never had anything like this. Did you put the dll in the top level vi list or something?


And what is your LabVIEW version?


Regards,


Wiebe.
0 Kudos
Message 2 of 10
(8,463 Views)

Hello aldoulif,

You do need to have the DLL in a specific directory for the executable to call it.  This link describes what the options are.

 

Regards,

Clint M
National Instruments

0 Kudos
Message 3 of 10
(8,452 Views)

Thanks Clint  and Weibi. I hope that this thread isn't dead.

The article Clint suggested (http://digital.ni.com/public.nsf/allkb/862567530005F09C862565C50068363D?OpenDocument) recommended that the DLL needs to be located in the same folder (with the labview exe) or in \windows\system. I tried both options without any luck.

 

I am not sure if the error I am getting (please refer to the 1st post to read the error) means that the labview exe cannot find the DLL.

Are there special settings to be done when creating the labview exe? Do I need to more the entire project to a new computer when trying to run the labview exe on a new computer? I don't add any dependencies when creating the project (I am using labview 8.0).

Help Please!

Thanks.

0 Kudos
Message 4 of 10
(8,400 Views)
Have you verified that the C++ DLL doesn't have any dependency problems on the target computer?
Regards, Guenter
0 Kudos
Message 5 of 10
(8,393 Views)
Hi Guenter...thanks for posting. I am going to give the "walker" a try.
Thanks!
0 Kudos
Message 6 of 10
(8,387 Views)

Even better (if you deal with DLLs frequently): Place a shortcut to the "walker" in your "Send To" menu. Then, right-click a DLL and select Send To >> Walker.

Have a nice day, Guenter

0 Kudos
Message 7 of 10
(8,378 Views)

I got the same problem.

 

When I started the app on an other computer than my development computer I get an error message:

"The file "xxx.dll"  is not a valid LabVIEW file."

 Same OS, same EXE, same DLL.

 

I also got other DLL calls in my app which don't make any problems.

 

I tried the walker dependcy programm and get the same result on both computers.

 

I don't know what happens.

 

 

 

Can someone help me please?

 

 BR, Thomas

 

 

0 Kudos
Message 8 of 10
(8,007 Views)

hi aldoulif...

 

you can find the DLL's directory from Project explorer> Build specification properties (right click build specification, click properties).

 

usually u don't need to use a seperate directory to save *.dll files. 

 

check the dlls are copied to the new directory or subdirectory after building the executable. 

 

RENN 

 

Kudos always welcome for helpful posts 🙂
0 Kudos
Message 9 of 10
(8,000 Views)
Hi, you say you ran the walker dependency checker on the .dll's that are giving you this error.  Did the checker indicate that those .dll's were calling any other .dll's?
Chris Bakker
SET Americas
CEO

0 Kudos
Message 10 of 10
(7,958 Views)