LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use a CVI 5.51 created dll in Visual C++ 6.0?

I have a simple CVI 5.51 dll that I want to use in Visual C++ 6.0. I have added the .h file and the .dll file to the project, and I have also added the .lib file for the dll to the project but I am still getting link errors. Are there other files I need to link in to this project to make it execute?

Thanks
Chris Davis
0 Kudos
Message 1 of 4
(3,204 Views)
Chris...

What are the specific link errors. Are they the functions that you wanted to export, or are they functions (like DLLMain, or DLLEntryPoint), or are they functions that you did not intend to export?
Give me an example of the link error, and I'll see if it brings back any memories..

Regards

Chris
0 Kudos
Message 2 of 4
(3,204 Views)
Chris,

This might be because the VC++ compiler mangles the name of the function(s). So to prevent this from happening you can include the __cplusplus ifdef in your header file.
For example :

#ifdef __cplusplus
extern "C" {
#endif
int __stdcall exportedFuncFromCVIdll (void) ;
#ifdef __cplusplus
}
#endif

This should take care of the name mangling and you should be able to use the CVI DLL functions.

Let me know if this doesn't work,

Azucena
0 Kudos
Message 3 of 4
(3,204 Views)
Thanks Azucena,
The solution you provided worked. BTW I had Link2001 errors with mangled function names.

Thanks,
Chris Davis
0 Kudos
Message 4 of 4
(3,204 Views)