LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.net object initialization for C# equivalent (object o = null;)

I'm trying to call some COM funcationality from a windows library. The function takes a reference to an object as one of it's parameters.

LabVIEW calls this parameter a variant.

 

In CSharp the call looks like this:

object o = null;

MyComFunction(string a, string b, ref o);

 

In LabVIEW I'm able to call the constructor for a generic .NET constructor, pass it to the input of ".NET object to variant" and the function call accepts this... but doesn't work right. I think I need to initialize the .NET Object somehow like I've done in CSharp by setting it to null.

 

Any ideas how to initialize this or if the constructor would be doing this automatically?

0 Kudos
Message 1 of 4
(3,692 Views)

Matt, 

 

I'm uncertain of exactly the result. Can you post a snippet of what you've got wired up?

Verne D. // Software R&D // National Instruments
0 Kudos
Message 2 of 4
(3,678 Views)

GenericObject.png

 

That's it. A generic Object to variant. The Library I'm passing it to is COM, so I'm not including that piece since it's really irrelevant.

0 Kudos
Message 3 of 4
(3,669 Views)

I'm curious about passing a null pointer as a parameter in general, what does the function prototype you're calling look like? Is there some documentation about the function that might help put this in additional context?

Verne D. // Software R&D // National Instruments
0 Kudos
Message 4 of 4
(3,660 Views)