Quick update on progress we have had today:
First, if we set up a .NET .dll and try to access an arrayList from it, there are no problems (e.g., direct access to a .NET object is fine). We can read and write elements to the arrayList. If we do the VB ActiveX wrapper around the .NET control, then we can read/write primitive data types (I32, string, etc.), but no complex types (arrayList).
Second, we verified that the arrayList pointer we are passing into LabVIEW is a valid pointer in two ways: 1) in LabVIEW, if we cast the pointer to a Variant and display it as an indicator, we get a non-zero number that looks like a reasonable memory pointer; 2) if we pass the pointer into LabVIEW, then back into VB, VB can access the arrayList with the returned pointer (hence the pointer is not corrupted by LabVIEW or set as a null pointer).
Third, we did find a non-optimal workaround. This involves the following steps: a) create an empty ActiveX container on the front panel of LabVIEW; b) creating the .NET object through a .dll (.NET Assembly) call; c) obtain the window handle from the ActiveX object (through an invoke node); d) set the parent window handle for the .NET object as the ActiveX object (through an invoke node); e) call the Show method on the .NET control (through an invoke node). This paints the .NET control into the ActiveX control. The non-optimal features of this are 1) you cannot see the .NET control until the program is run, so screen layout is not particularly easy; 2) when the LabVIEW application exits, the .NET control dissapears (so any displays or information in the .NET control is lost); 3) from a usability standpoint, now instead of just providing a pallet of ActiveX controls to my customer that they can just drag to the front panel, I need to provide multi-step instructions on creating a control (we are using LabVIEW for its simplicity, which this solution is not) that has no positive feedback until runtime.
Joe Gerhardstein
Viasat
Certified LabVIEW Architect
Certified TestStand Developer
Certified Professional Instructor
http://www.viasat.com