11-03-2010 09:51 AM
Hello,
I am using a custom .NET assembly with LabVIEW 10.1. I am using a .NET Constructor Node to create an object, and then using Invoke to call a method on that object. This method takes two parameters, one of which I want to pass in a "null" value. Similar C# code would be:
MyObject obj = new MyObject(); obj.func(10, null);
How can I specify this null value using LabVIEW?
Also, is there a way to remove private assemblies from the "Select .NET Constructor" window? I updated my private assembly to a newer version, selected it with browse, and a message pops up to say "The version of the assembly you requested was automatically promoted to a later version by the runtime engine." and then select the older version of my assembly. I cannot select the new version of the assembly.
Thanks in advance.
11-04-2010 07:52 AM
Any advice? Just to clarify the situation, here is some C# code that gives the func prototype:
public class MyObject { // Snip public void func(int a, MyParameter b) { // Snip } } // Snip MyObject obj = new MyObject(); obj.func(10, null);
So the parameter that I want to specify as null is of a custom type.
11-04-2010 09:11 AM - edited 11-04-2010 09:11 AM
I could have sworn this question had been asked before, but a search only yielded a similar question about passing in a null reference to a string input. I don't know if there's a direct way to create a null object, but you can cheat:
01-28-2011 11:19 AM
Creating a constant from the method's input parameter seemed to work for me...