D
Dinsdale
I am trying to determine what the current cast of an object is.
Essentially, if I use GetType, it always returns the original type of
the object created but I want to know what the current cast of the
object is (i.e.: is it still cast as a Derived class, or is it cast as
a Base class?) Here is some pseudo code to show the example.
Class Base
....
End Class
Class Derived : Inherits Base
....
End Class
Public Sub Main()
Dim derived1 as New Derived()
Dim base1 as Base
base1 = Ctype(derived1, Base)
Console.Writeline (base1.GetType().ToString())
End Sub
'Output would be "Derived". How to I determine what the CAST is? i.e.
Base?
Thanks in advance.
Dinsdale
Essentially, if I use GetType, it always returns the original type of
the object created but I want to know what the current cast of the
object is (i.e.: is it still cast as a Derived class, or is it cast as
a Base class?) Here is some pseudo code to show the example.
Class Base
....
End Class
Class Derived : Inherits Base
....
End Class
Public Sub Main()
Dim derived1 as New Derived()
Dim base1 as Base
base1 = Ctype(derived1, Base)
Console.Writeline (base1.GetType().ToString())
End Sub
'Output would be "Derived". How to I determine what the CAST is? i.e.
Base?
Thanks in advance.
Dinsdale