C
Crirus
Can I use DirectCast to convert a object to it's base or should I use CType?
I have a instance of a class as Object.
The run-time tipe is a derived of a class, but I need to refer to that
instance as to the base class
Ex: Class BaseCl
Class DerivCl
Inherits BaseCl
'Run-time
Dim thisCl as Object= new DerivCl
Can I use DirectCast(thisCl, BaseCl).baseClMethod ... ?
I have a instance of a class as Object.
The run-time tipe is a derived of a class, but I need to refer to that
instance as to the base class
Ex: Class BaseCl
Class DerivCl
Inherits BaseCl
'Run-time
Dim thisCl as Object= new DerivCl
Can I use DirectCast(thisCl, BaseCl).baseClMethod ... ?