LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

refnum more specific class error

I am trying to make a general control reference number into the more specific TabControl refnumber, but when I try using the "To More Specific Class" VI with a TabControl reference constant, I get the following error:
 
Code: 1057
Error:  Type mismatch: Object cannot be type casted to the specified type.
 
I have posted a picture of what I am trying to do (the false case just passes the boolean through).
Is there a reason that I am not able to nake the more general control reference into a TabControl refnum?
 
Thanks.
--Robert


Message Edited by knapkerd on 06-19-2008 11:28 AM

Message Edited by knapkerd on 06-19-2008 11:28 AM
0 Kudos
Message 1 of 5
(3,358 Views)
Sorry, I did not realize the constant was in Japanese.  That is the Tab Control constant refnum.  I have also tried the choose page constant refnum, which retuned the 1055 error or an invalid object.
 
--Robert
0 Kudos
Message 2 of 5
(3,342 Views)

Hi Robert,

see the attached example please, it works without an error.

Hope it helps.
Mike

0 Kudos
Message 3 of 5
(3,337 Views)


knapkerd wrote:
 
Is there a reason that I am not able to nake the more general control reference into a TabControl refnum?
Yes, there is.
What you're attempting to cast is not the tab control, but its owner, which would be either the panel or the pane. If you use the control reference it should work.
 
As a side point, a simpler way to do this would simply be to type cast until you get no error (instead of comparing to the class name). If you need more than one class you can wire the string directly into the case structure selector.

___________________
Try to take over the world!
Message 4 of 5
(3,335 Views)
Wow, thanks a bunch guys.  That makes alot more sense now.
 
Thanks for the tip tst, I will try that out.
--Robert
0 Kudos
Message 5 of 5
(3,330 Views)