12-27-2007 10:18 AM
12-27-2007 10:51 AM
The behavior you are seeing is related to how we display .NET static classes in
the Select .NET Constructor Dialog Box. In LabVIEW 7.1.1 and LabVIEW
8.0, we did not display static classes in that dialog box but in LabVIEW 8.2.1
(I can't remember if it was LabVIEW 8.2 or 8.2.1) we started actually showing the user
the static classes. Thus in LabVIEW 8.2.1, you can bring up your static class in the Select .NET Constructor dialog, but you can't click OK
because there are no constructors (i.e. which makes sense since we are dealing with .NET static classes).
It is important to note that .NET static classes cannot be instantiated (i.e.
you can't create objects but rather you directly access the methods and
properties). To call static methods or properties, you
1) Drop down an invoke node or property node from the .NET palette
2) Right-click on the top-left terminal and select Select Class » .NET » Browse from the shortcut menu to display. Then browse to your .NET
assembly and choose your
.NET class.
3) Choose a method or property or your static class.
12-27-2007 11:21 AM
We've done as suggested above and are still having problems. When calling a static method within a static class we are getting an error (1172-Exception has been thrown by the target of an invocation. >> The type initializer for 'CALModel.DataLayer.DAOFactory' threw an exception. >> Object reference not set to an instance of an object. in Test.vi) however when we call a static method within a general class we get no error. Any ideas? Are there any examples of calling static methods that we could reference to ensure that we are doing everything correctly on the .net side, specifically using static classes?
Thanks for your help...
12-28-2007 07:43 AM
02-06-2008 09:09 AM
02-06-2008 09:38 AM