LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV 6.1 built dll won't work when called from VC++ code

Now I have a BIG problem. Code I wrote in VC6( debug mode )that calls a dll written in LV 6.1, that works fine on my machine, exhibits a bogus LV 6.1 runtime engine error( I have it installed and I know it's working )when I try to run it from another machine,OR when I run it on my machine and the calling code was compiled with VC6 in RELEASE mode or compiled in VC7 in either mode --- i.e. when I use the Copiled C++ code on my on my machine it works fine, but when I copy the dll to another person's machine, she gets the same bogus LV 6.1 runtime engine error when she tries to access the dll, that I get when I try to use it on my machine and I compile it in VC7 or VC6 release mode. Note, we both have the latest
version of the LV runtime engine 6.1 loaded.

The labview dll is written and built into a dll using labview 6.1. The dll when called by code written in VC6 and compiled in debug mode works on my machine, but when I compile the code in VC6 release mode, or write it and compile it in VC7( debug or release mode ) I get the error( see screen shot file ) when the dll that was written in labview is loaded by the calling code.

It's absolutely essential that this code can work on the client's machine. Our whole project was developed with the intention of reusing this labview code as a dll by components written in VC++.

Thanks for any assistance. -Dino
0 Kudos
Message 1 of 3
(2,468 Views)
hi
are you sure your LabVIEW dll has all it needs to execute on your target platform? i'm thinking of some secondary dlls or Vis called dynamically (sounds like you call some kind of driver inside your dll).
are you using the same output directory and output filenames in both the release and the debug-configuration? if not i think the release-dll may can't find some other dll.

good luck
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 2 of 3
(2,468 Views)
This issue was several workarounds until this issue is resolved in a future release of LabVIEW-

1. Link with the DLL form of MFC.
2. Do not link with the .lib from the LV DLL, instead use LoadLibrary and GetProcAddress to dynamically load the DLL and call the function.
3. Use the VC delayload feature to make the LV DLL not get loaded until the first call is made into it. See VC help on "delayload" for information on setting this up. In a nutshell, under Project -> Settings -> Link add "delayimp.lib" to Object/library modules and in the the Project Options box append the following string: /delayload:"sampleDLL.dll"


where sampleDLL.dll is the name of the dll you want to delayload.
0 Kudos
Message 3 of 3
(2,468 Views)