F
fred
I know I can convert an instance of a class to an instance of any class type
from which the original class is derived.
So is it possible to convert the other way. E.g.
Let Class Ford be derived from Class Car.
Dim F as New Ford(...)
Dim C as Car
C = CType(F, Car)
F = Nothing
'This conversion works OK and C.GetType.Name is Ford so now how can I
convert C back to a Ford.
F = CType(C, Ford) 'This does not work at runtime although the compiler
thinks its OK.
Since C.GetType is a Ford type why can't I convert to a Ford Class?
Thanks for any help
Fred
from which the original class is derived.
So is it possible to convert the other way. E.g.
Let Class Ford be derived from Class Car.
Dim F as New Ford(...)
Dim C as Car
C = CType(F, Car)
F = Nothing
'This conversion works OK and C.GetType.Name is Ford so now how can I
convert C back to a Ford.
F = CType(C, Ford) 'This does not work at runtime although the compiler
thinks its OK.
Since C.GetType is a Ford type why can't I convert to a Ford Class?
Thanks for any help
Fred