Jump to content

How can I convert LVclass object to .NET object?


Recommended Posts

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.

Link to comment

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.

Link to comment

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.

Link to comment

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

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.