Jump to content

Class by parameter


Recommended Posts

Hi everybody,

I created a C# DLL has a Class named "ClasseDadosPontos".

A labview dll. In this dll I need to manipulate the class "ClasseDadosPontos".

In another C# dll I need to call the labview dll passing by parameter the "ClassDadosPontos".

imagem.jpg

But allways i tried to call this, "ClasseDadosPontos" return a erro that says .NET Refnum is null!!!

Thanks for your help

Gustavo

Link to comment

Hi Gustavo

I've created dot net code that I call from LabVIEW without any problem, I also got the dot net code to invoke a VI when special event happens that the dot net code is controlling.

I don't really understand what you are trying to achieve.

But just to be sure, have you opened/called a constructor of the dot net class before you used it?

You can create several constructors for a dot net class, the constructor in the example below takes 3 arguments.

post-941-1216242998.png?width=400

Cheers,

Mikael

Link to comment

Hi Mikael,

I'm seendig a new picture of my process, i need to send my object "ClasseDadosPontos" from my C# application to labview dll. and labview will process the data and return to C# application a value.

processo.jpg

I made as you said but i don't need to create a instance in labview a need to send the instance from C#.

I created a text file to return the error, and the returned error was:

Status: 1

Code: 1

Source: Property Node in Tempo.vi->Tempo.vi.ProxyCaller

But I don't know what this mean!!!

Cheers,

Gustavo

Link to comment

I'm not sure you can pass a .NET refnum across a DLL boundary like that. If I'm not mistaken, .NET references are only valid within the appdomain which created them, but you should verify that.

What you might want to do is call the .NET code inside the C# application and only transfer the simple values.

Link to comment

QUOTE (Yair @ Jul 17 2008, 02:05 PM)

I'm not sure you can pass a .NET refnum across a DLL boundary like that. If I'm not mistaken, .NET references are only valid within the appdomain which created them, but you should verify that.

What you might want to do is call the .NET code inside the C# application and only transfer the simple values.

I need to pass like that because, this is just a test, I will need to pass an array of that object, with about 100000 os elements, if I pass this one by one it ill be very slow.

Thanks

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
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.