LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I downloaded a third party API from ICQ to consider to integrate ICQ with my CVI application.



There are three main issues standing in my way: 1) the include files have some wierd definitions for example:

BOOL WINAPI ICQAPICall_GetOnlineListPlacement(int &iIsShowOnlineList);

BOOL WINAPI ICQAPICall_GetWindowHandle(HWND &hWindow);

CVI is complaining about the &.

2) the other issues deals with a link error "undefined symbol
_ICQSet_LicKey@12". I suspect that I have an import library issue? They did
claim that the api is in a icqapi.dll which they supplied me. They also
supplied a icqapi.lib file, which I am assuming is the import lib? If not,
can someone remind me of how to build an import lib from the include files?

3) the email list for
CVI doesn't seem to be working.
0 Kudos
Message 1 of 2
(2,886 Views)
Rich:

I believe the source of your problem is that you are attempting to use a C++ DLL in LabWindows/CVI--which is an ANSI C compiler and does not support C++. The ampersand "&" used in this context signifies a variable passed by reference, which is not available in ANSI C. Furthermore, C++ DLLs usually use name mangling, which ANSI C does not support. Name mangling probably explains your link errors.

You can use the phrase extern "C" around the prototypes in a header file to disable C++ name mangling so the DLL can be used in ANSI C. However, this change would require you to re-build the DLL from source that you probably don't have. You can ask LabWindows/CVI to build an import library from the DLL and the source code, but LabWindows/CVI will not mangle the names in
the header file and thusly won't be able to find them in the DLL.

This doesn't leave many alternative that I can think of, especially if the API in the DLL uses call by reference. The best people to talk to would be ICQ; ask them if there exists an ANSI C API, and explain why this DLL won't work in ANSI C. You may also want to contact National Instruments technical support at 1-800-IEEE-488 or http://www.ni.com/support for other possible alternatives.

Best Regards,

Chris Wood
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,886 Views)