LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

problem running c dll in labwindows

I have generated a dll using microsoft visual studio c++, which works when called from another c++ program. However, when I call it from Measurement Studio, it fails. The code is based on an example from Logitech to drive their web cameras, but the problem occurs before any calls to Logitech-specific routines.
The problem occurs when I call coinitialize(NULL), eg
if (!CoInitialize(NULL)==S_OK) { return 10; }
I can call simple C++ dlls from LabWindows, and I can get dummy values returned from this dll if I dont call CoInitialize, AtlAxWinInit() etc. I am using the dllexport format as per your examples.
Is this some problem with the concurrency model of the DLL, or something else?
Thanks,
Ed Roberts
Australian National Un
iversity
0 Kudos
Message 1 of 2
(2,895 Views)
Hi Ed...

I don't really know if I do understand well question but here is a try...

Ok... I had the same problem a time ago with the Spech SDK from Microsoft...

The problem is that the input/output of a certain DLL is in pure C++... and CVI is purely ANSI C... so it can't work...

So one thing you can do is write an other DLL "Wrapper" in which you make your call to the DLL I/O function in pure C... "__stdcall funct_blablabla(....)" and within the new function you do your C++ stuff... but the interaction is in C...

This is a bit sad but this is trade of using CVI SDK which is great....

Best Regard

Steph
0 Kudos
Message 2 of 2
(2,895 Views)