huotom Posted November 10, 2009 Report Share Posted November 10, 2009 Dear all, I meet some problems when I am using OOP in LabVIEW with .NET Container. How can I convert LVclass object to .NET object? In C#, we can show all the properties in Property Grid control. Now, if I want to show my lvclass object's properties in the Grid, how can I convert LVclass object to .NET object? I searched the functions inside LabVIEW but coult not find the properly one. The "To .NET Object" Vi dosen't support LVclass. Is there anyone who can help me? Thanks very much if you can give an example. I'm using a .Net container with a windows form 2.0->propertyGrid. The property being used is "selectedobject". We can get infomation about the PropertyGrid at MSDN. Thank you again. Quote Link to comment
PaulL Posted November 12, 2009 Report Share Posted November 12, 2009 How can I convert LVclass object to .NET object? You can't. I independently tried this just the other day and the "To .NET Object" method always returns an error method such as the following: "Error 1199 occurred at Invoke Node in To .NET Object.vi->Untitled 37 Possible reason(s): LabVIEW: Cannot convert the specified LabVIEW type to .NET object. Method Name: .NET:Convert To .NET Type" This is most unfortunate. Quote Link to comment
huotom Posted November 13, 2009 Author Report Share Posted November 13, 2009 You can't. I independently tried this just the other day and the "To .NET Object" method always returns an error method such as the following: "Error 1199 occurred at Invoke Node in To .NET Object.vi->Untitled 37 Possible reason(s): LabVIEW: Cannot convert the specified LabVIEW type to .NET object. Method Name: .NET:Convert To .NET Type" This is most unfortunate. Thanks a lot. I think there must be large differents between lvclass and .net or java class, although they are a bit similar. I want to use this method as I am interesting in the PropetyGrid in C# 3.5. In C# class, there is property except member or method which can be used for PropertyGrid~~ Oh, my god, I must write the propertyGrid in LV by myself now. Quote Link to comment
Mark Smith Posted November 13, 2009 Report Share Posted November 13, 2009 Maybe you don't need to convert a LabVIEW object to a .NET object. I'm not sure exactly what you need, but if you just want to use the Property Grid control in LabVIEW, that can probably be done. Check out these links http://zone.ni.com/reference/en-XX/help/371361B-01/lvhowto/create_dotnet_controls/ http://zone.ni.com/devzone/cda/pub/p/id/230 Mark Quote Link to comment
huotom Posted November 13, 2009 Author Report Share Posted November 13, 2009 Maybe you don't need to convert a LabVIEW object to a .NET object. I'm not sure exactly what you need, but if you just want to use the Property Grid control in LabVIEW, that can probably be done. Check out these links http://zone.ni.com/r...otnet_controls/ http://zone.ni.com/d...da/pub/p/id/230 Mark Thank you, Mark. In LV, we could get the property/member one by one, not all at one time. Otherwise, we can get all properties shown in a Property Grid in C# by giving the "Selected Object" a .net object. And I think Property Grid is a good partnerf for OOP. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.