LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use GenICam USB camera with .dll (Thread crahs at program start)

Hello,

my problem is the usage of a "Crevis" USB camera in a CVI Application, using the .dll.

After Adpating the headers for CVI (compiler type, varibales etc.) a demo application compiles with the "TLI.lib". Seems fine.

 

Starting up the Application in any configuration from the CVI-IDE, I get a " FATAL RUN-TIME ERROR:   Unknown source position, thread id 0x00000134:   A non-debuggable thread caused a 'General Protection' fault at address 7C914D36."

Thread-ID is changing, Adress always the same.

The crach seems to occur right at start, a breakpoint in line 1 of main is never reached.

Calling the debug or release output from explorer dowes not give any echo on my maschine.

 

I can compile adapted headers still with Visual C++ and run the Demo-Application correctly.

Any suggestions, what might happen in CVI? 

Any ideas, how to debug this thing? How to see, what crashes?

I suspect, that I am missing some basic setting in the linker or something..

 

 

Martin

0 Kudos
Message 1 of 3
(4,190 Views)

The first thing that springs to mind is that during the adaptation of the headers for CVI use, you have accidentally changed the calling convention for the dll. Such publicly distributed dlls usually have a _stdcall convention, while most standard C code is _cdecl. Might be worth double checking this area.

 

JR

0 Kudos
Message 2 of 3
(4,179 Views)

Hello again,

as suggested by the first reply, I have checked for the __Stdcall issue.

To be more sure, I have stripped away all the preprocessor stuff and concentrated on a very simple console Application:

The simplified project

 

I am using CVI defaults nothing special is given in the settings.

The crash at start still occurs, the first printf never being reached.

 

0 Kudos
Message 3 of 3
(4,168 Views)