05-24-2006 12:00 PM
05-24-2006 05:08 PM
Hello Martin.
By right-clicking on the "Call Library Function Node" and selecting "Create .c File ..." you can get some C code that points out how data is passed from LabVIEW to the DLL.
Focus on the strings: They are not passed by a pointer to the string. The internal representation of a LabVIEW string contains the string length in the first four bytes (representing an Int32) followed by the string bytes. LabVIEW passes the pointer to that Int32 to the DLL and expects that the DLL knows that the string starts 4 bytes later.
This makes your DLL call crash.
As solution to this requires that you create a (LabVIEW compatible) wrapper for the DLL you want to call.
Using Structures in a DLL with Clusters in LabVIEW also deals with how to pass LabVIEW clusters to a DLL. Also look at the LabVIEW help topic "How LabVIEW stores data in memory"
Best regards, Guenter