09-19-2006 04:37 PM
I've been struggling with trying to pass error cluster data in and out of a Labview 7.1-built DLL from a C# program. I've found many entries in the discussion forum that come close to answering my problem but most of the discussions are dealing with C or C++ or they are dealing with passing the data from Labview to a DLL made by C or C++.
One of the challenges with C# is that you have limited use of pointers in "unsafe" code blocks. The C definitions associated with the Labview error cluster are:
typedef
struct { // The Error Cluster as a structureNote that the string member is really a Handle, .i.e., a pointer to a pointer. C# doesn't allow the use of pointers to managed data like Strings and Arrays. It also doesn't allow pointers to structures containing managed data. I have been unable to find a way to marshal data from the "unmanaged" DLL code to the "managed" C# code. I have been able to marshal in a Labview string when it is a separate parameter. The problem occurs when the LV string is a member of a cluster.
09-20-2006 09:56 AM