christophe74 Posted January 12, 2010 Report Posted January 12, 2010 Hello, I have been using LabVIEW for nearly 10 years but I have to admit I am a little stuck. I have to use several VC++ DLLs from LabVIEW 2009. I have no choice than using those DLLs as the code is very large and there is no time to revert back to LabVIEW only. I have found a good article about calling C++ using a C wrapper at http://labviewwiki.org/DLL/shared_library I was wondering if someone had done something where instead of calling a double it would be an object. Any help would be welcome. Many Thanks, Christophe Quote
Aristos Queue Posted January 18, 2010 Report Posted January 18, 2010 On 1/12/2010 at 7:28 PM, christophe74 said: Hello, I have been using LabVIEW for nearly 10 years but I have to admit I am a little stuck. I have to use several VC++ DLLs from LabVIEW 2009. I have no choice than using those DLLs as the code is very large and there is no time to revert back to LabVIEW only. I have found a good article about calling C++ using a C wrapper at http://labviewwiki.o.../shared_library I was wondering if someone had done something where instead of calling a double it would be an object. Any help would be welcome. Many Thanks, Christophe The only DLL calls I've had to make to C++ all involved a C interface where I just needed to pass the pointer to the class (which LV can easily hold onto in a uInt32 or a uInt64 as long as LV isn't expected to access the data of the object directly). I'm sure there is a solution if the interface is actually a C++ exported function, but I don't know what it is. This may be a question better posted on NI.com/forums pages. The AEs there get questions about DLL calls all the time and may have a ready answer for you. No promises, but I'd suggest trying it. Quote
Rolf Kalbermatter Posted January 27, 2010 Report Posted January 27, 2010 On 1/18/2010 at 4:53 PM, Aristos Queue said: The only DLL calls I've had to make to C++ all involved a C interface where I just needed to pass the pointer to the class (which LV can easily hold onto in a uInt32 or a uInt64 as long as LV isn't expected to access the data of the object directly). I'm sure there is a solution if the interface is actually a C++ exported function, but I don't know what it is. This may be a question better posted on NI.com/forums pages. The AEs there get questions about DLL calls all the time and may have a ready answer for you. No promises, but I'd suggest trying it. Calling C++ functions gets nasty if you have several variants of the same function with different parameters since you have to figure out which decorated function name you want to access for a particular parameter version. And the decoration while logically corresponding to the parameter list, is anything but easy to decipher (and varies between C compilers too). Accessing methods and member elements of objects will only be doable with C wrapper interfaces though. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.