Brian:
RE: problems emailing the LV/VB/.NET example program, code is attached to this email.
Instructions for code use:
1) Run setup.exe to put the VB OCX and VB engine onto your computer (you will get an uninstall option in your Add/Remove programs Control Panel).
2) from the VS .NET command prompt, go to the directory where you installed the OCX, and type "regasm DotnetCtrl.dll /codebase" to register the assembly.
3) In LabVIEW, add the DotnetCtrl.dll assembly to the .NET Assembly References.
4) In LabVIEW, add c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll to the .NET Assembly References (this contains the ArrayList).
5) Open Untitled.vi (the VI should be in the same directory as the OCX in order to load the .NET control).
If everything is all right, the front panel should come up with a .NET control in an ActiveX container (the control should have the current date and time, along with a functional "click me" button). On the block diagram, we take the OCX reference and get the .NET reference (property "CtrlFromDotNet"). The .NET reference can pass out an ArrayList reference with the "getArrayListData" method.
LabVIEW knows that this is an ArrayList, but there are no properties or methods available with it. If I create an ArrayList assembly reference in LabVIEW, and try to type-cast the .NET-provided one to this, I can see the properties and methods it should have, but get an error when I try to use them (it appears the type-cast reference is a null reference).
Joe Gerhardstein
Viasat
Certified LabVIEW Architect
Certified TestStand Developer
Certified Professional Instructor
http://www.viasat.com