LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems using third-party DLLs...creating working executables

Hi,
 
i use 2 PC-cards they comes with a dll-, a lib and a Header-File. The lib-files bring up compiling-errors, so i create a new one with the header-Files. Now my project compiles fine. But another problem comes up :
 
- only if i create an executable file in the "debug"-mode, it can access the PC-cards. In "Release"-mode it hangs with a "general protection fault" at the begining of the pc-card initialisation....
 
Where is my problem ? Any hints ?
 
My system :
 
Win2000/sp4/
CVI7.0 full-dev.
 
Greets
Marc
 
0 Kudos
Message 1 of 2
(2,616 Views)
Marc,

there can be several issues which can create unexpected behaviour of the application. especially the point that the lib-file creates compilation-errors is very....strange. this should not happen if the DLL has been created in a proper way.
i asume that these errors are either linker-errors or "unknown function"-errors. in general, the lib-file contains the info for the developement system where the individual functions can be found within the DLL. so either there is a problem that the calling convention does not fit at all or (regarding the lib-file) it does not match the DLL at all (version-infos?).
the calling convention-problem can create runtime-errors as well, since it specifies the way how parameters are passed to and from the stack. so in general, there can occur a general protection fault when passing an array or string in the wrong calling convention. the big question is, why does it work in debug?
afaik there is no special difference between debug and release except the debugging-capabilities, which create an overhead to the code and, maybe the reason here, a slightly different timing-behaviour. maybe you should add waiting-functions here and there just to check that possibility. and, of course, you should check the compiler-options.

Norbert B.
- NI Germany
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 2
(2,580 Views)