06-03-2011 09:01 AM
Hi all,
I am currently using a 3rd party DLL from SCANLABS to communicate with a galvonometer control card (SCANLABS Scanalone).
There two important functions, SCANalone4open() and SCANalone4close(), which are required for using the DLL. However, they are not able to be detected by the Call Library Function node (see screenshot1.jpg). Looking at the header file, it appears that these two functions were
not exported with the (stdcall) calling convention as the other functions (see screenshot2.jpg).
Thus, I am writing a wrapper function in C to call these two functions. I will then build this wrapper into a DLL and call it from LabVIEW.
I am using Visual C++ Express 2008 to create this wrapper. After building the wrapper DLL, I called it with the Call Library Function node. However, there were some weird symbols inserted into the wrapper function name (see screenshot3.jpg)
May I know what is the cause of this and is there a way to solve this? (btw I have also attached the VC++ project and files together with it)
Thanks alot.
Best regards,Victor
Solved! Go to Solution.
06-03-2011 09:04 AM
The Visual C++ project files are attached in this zip file here... 🙂
06-05-2011 04:01 PM
just add extern "C" in function name declaration, like: extern "C" __declspec(dllexport) int function_name()
....
or use a DEF file
06-14-2011 11:49 AM
Thanks cosmin, adding the extern "C" declaration solves the problem. 🙂
06-14-2011 12:35 PM