LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

getType for system.single .NET structure

In order to determine the data type of a reference being passed to me from .NET, I need to create a "type" for each possible data type it might be and do a comparison (isAssignableFrom) to see if the reference being passed is of this type.  Most of the types I am using are complex types generated within our .NET code and I can create a Contructor for that class and use the "GetType" .NET method to determine the type.  However, one of the types that can be passed is a 32-bit floating point.  I have tried to create a constructor using mscor.lib's system.single, but there is no constructor available here as it is a "primitive".

Any thoughts on how to create a 32-bit float "type" I can use as an input to the "IsAssignableFrom" function?
Joe Gerhardstein
Viasat
Certified LabVIEW Architect
Certified TestStand Developer
Certified Professional Instructor
http://www.viasat.com
0 Kudos
Message 1 of 2
(3,081 Views)
Actually it would probably be easier to use the static method of Type to get a specific type. This will also reduce the burden on the garbage collector by not creating these temp. objects. There are two ideas I have...
 
1. Use Type::GetType(string), where you pass the fully qualified name of the type you want. This is a bit of a pain in that you need the full assembly name. Thus the float would be something like
 
System.Single, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
 
2. Create a helper routine in .NET. For example, in C#, you can do something like
 
System.Type mytype = typeof(System.Single);
 
 
Message 2 of 2
(3,077 Views)