LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

steps to integrate 32-bit dll written in VC++ in LabWindows

List out the steps required to integrate the dll written in VC++ in LabWindows
0 Kudos
Message 1 of 4
(3,567 Views)
1. Copy the .dll, .lib, and .h file from VC++ to your LabWindows project directory.
2. Add the .lib file to your CVI project list.
3. #include the VC++ .h file in any CVI .c file that will call a function in the VC++ DLL.
4. You're ready to use CVI to call functions from the VC++ DLL.
Since CVI is ANSI C and not C++, there are some restrictions on the VC end. All the exported functions need to be be extern'ed as C functions. For example, in the VC .h file, look for these blocks surrounding the function prototypes.

#ifdef __cplusplus
extern "C" {
#endif

// prototypes of functions exported for CVI to call

#ifdef __cplusplus
}
#endif
0 Kudos
Message 2 of 4
(3,567 Views)
There's more info in the discussion here.
0 Kudos
Message 3 of 4
(3,567 Views)

Al S wrote:
There's more info in the discussion here.

Can we be more specific?

 

I am trying to call a VC++ DLL. I'm not quite sure how to moify the .h file containing the function prototypes.

 

A snippet from the original  .h file"

 

// Open grabber. int __stdcall Open(HANDLE &InterfaceHandle, int SourceIndex, int Width, int Height, int Rate);

 I changed it to:

 

 

// Open grabber. __declspec(dllexport) int __stdcall Open(HANDLE *InterfaceHandle, int SourceIndex, int Width, int Height, int Rate);

 

I can compile, but I get an "Undefined Symbol" error while linking. I've moved the lib file to the project folder with no change in results.

 

 

 

 

 

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