LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error inserting .NET System.Windows.Forms.Form

I'm a newbie to .NET. I'm trying to insert a System.Windows.Forms.Form into a .NET container on a Front Panel, but get an error: "Error Inserting ActiveX or .NET object: Exception occurred in System.Windows.Forms: Top-level Windows Forms control cannot be exposed as an ActiveX control"
Can someone explain this? I have a .NET program whos main window is a System.Windows.Forms.Form, so I was hoping to embed it into LabVIEW and use it inconjunction with LabVIEW.
Using LV 8.5, Windows XP
 
Michael


Message Edited by miguelc on 03-24-2008 04:46 PM
0 Kudos
Message 1 of 3
(3,635 Views)
Hi miguelc,

This error appears to be generated by .NET/ActiveX rather than by LabVIEW itself.  I found an external site unrelated to LabVIEW coding where a user had encountered the same error.

If you are trying to use a .NET container, perhaps you should try an ActiveX container instead.  Also, if you are able to succesfully call it in another programming language, if you could post that code here we may be able to help you figure out exactly how to translate that to LabVIEW code.
Eric V
National Instruments
Applications Engineer
Certified LabVIEW Associate Developer


"I'm a Ramblin' Wreck from Georgia Tech and a helluva (NI Applications) Engineer!"
0 Kudos
Message 2 of 3
(3,598 Views)

Hi miguelc,

Windows Forms are not .NET controls and therefore you cannot insert them into a .NET Container whose purpose is to host WinForm controls.  Anything you can drop onto a Windows Form in Visual Studio, you should be able to insert into LabVIEW via the .NET Container.

Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 3 of 3
(3,583 Views)