LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Follow Up: Get Reference Type From Variant

Hi,

   Quick Question! Let's say I have a reference, and I convert it to the variant type. Is there any way to get the type of the control that the reference points to from the variant?

Thanks!
-Ken
0 Kudos
Message 1 of 3
(3,566 Views)
Yes, you use the "variant to data" primitive and wire in a generic control ref num, and you can still get the correct class ID back out.

Message Edited by Stradis on 07-10-2007 02:46 PM


Paul
Message 2 of 3
(3,561 Views)
I don't know if this is the solution that works for you, but here is one way.  You can place a generic refnum control [Controls Palette>>>Refnum>>>Control Refnum] on your subVI's front panel, and wire that into the "type" input of the Variant to Data function [Functions Palette>>>Advanced>>>DataManipulation>>>Variant>>>Variant to Data].  This will convert the variant back to a refnum.  From there, you can use a property node [Functions Palette>>>Communication>>ActiveX>>Property Node] and look at, for example, the ClassID property.  This will return a U32 representing the control type.  Watch out if at some point you convert the specific control reference to a more generic reference because you may lose the ClassID value.

Message Edited by boomer on 07-10-2007 03:28 PM

Message 3 of 3
(3,550 Views)