"Calling functions that are in a class based DLL (MFC extention DLL)
I have a DLL written in VC++ using MFC exteintion DLL.
The functions are used to extract information from a hardware card.
eg.:
class AFX_EXT_CLASS WSDevice : public cAsyncSocket
This is a class in a DLL. There are a number of functions in this DLL
that we need to call from Labview 5.0
How do we call these functions?
Normally (in VC++ /C++) we ceate a instance of this class like
WSDeviceObj and use the function call :
WSDeviceObj.fucntion name
Kindly Help.
Satish Narayana"
Use the "call library" vi from the advanced menu. Right click on the vi
and select configure to enter the information about the dll and the function
you want to call.
Inside the Wrapper DLL you load the exported class library and insert an
instance. Then add all needed functions and export them, i.e:
#ifdef __cplusplus
}
#endif
__export void Open( ...);
__export void Close( ...);
__export void Read( ...);
...
#ifdef __cplusplus
}
#endif
Inside this new functions you can use the created instance of your class
with it's member functions.
good luck
Henrik
Joe
Guidelines on how to create a dll that can communicate with LabVIEW
are provided in the document "Using External Code in LabVIEW", which
should be included with LabVIEW. You can download the document also
from www.ni.com at:
http://digital.ni.com/manuals.nsf/web_productcurrent/4F1447F7CD83D6D88625690D00637CED?OpenDocument
Regards;
Vargas