LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple LabVIEW Class Error

Solved!
Go to solution

Im just trying to learn about classes.  Here is a simple program that is throwing an error on the class down-cast -

TrapperDoo_0-1669650649536.png

Why is this error happening?  The Parent-Child hierarchy is correct.  I created "Method 1.vi" of the Parent using the Dynamic Dispatch template and set it to "must override".  The child "Method 1.vi" is a VI for Override of the parent. version of Method 1.vi.

TrapperDoo_1-1669650922867.pngTrapperDoo_2-1669650978662.png 

TrapperDoo_3-1669651142833.png

 

 

0 Kudos
Message 1 of 3
(729 Views)
Solution
Accepted by topic author TrapperDoo

A Parent is not a Child.  So if you initialized as a Parent, you cannot downcast to a Child.  If you started with a Child, you can upcast to a Parent and later downcast to a Child.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 3
(719 Views)

I get it now.  Thanks for helping me.

0 Kudos
Message 3 of 3
(613 Views)