06-01-2012 03:58 AM
Hello,
Can someone help me to convert the attached C++ .cpp file to a DLL that i can use with Labview?
Thanks in advance
\phlip
06-01-2012 07:40 AM
Umm... what?
Are you asking how to write a C++ DLL? This is a really bizarre request to make on a LabVIEW forum.
Be aware that LabVIEW handles only C DLLs, not C++ DLLs.
06-01-2012 07:45 AM
Well, you need to wrap the C++ object into standard C functions and create a wrapper DLL from that code, in order to access this DLL. LabVIEW can NOT create std:: datatypes to pass to the DLL so what you need to do is create a the wrapper in C++, that exports standard C functions for the constructor and every object method. If you need support for the callback it gets even more complicated as you will have to convert the callback in your C wrapper into a LabVIEW user event.
This is anything but trivial work even for me and I guess I would work a day or three on this, before having everything so far, partly because I have no idea at all about std:: types so far. If there is a change to get the TCP/IP protocol specification of the device, I would certainly think that creating a VI library based on the TCP function nodes would be probably easier to implement than trying to wrap this DLL so it can be called with the Call Library Node. Another approach would be to turn this into an ActiveX object, as C++ to ActiveX should be fairly straigth forward, but I don't have any idea about how to go about this in detail.
06-01-2012 07:51 AM
Rolf,
I suspect that, given the nature of the question, everything you said probably went right over his head. Woooosh.
06-01-2012 07:54 AM
Tnx for the replies , i understand that it is not easy to convert.