J
Joe Duchtel
Hello -
I have the following scenario ...
Class cBase
End Class
Class cChild
Inherits cBase
End Class
Then there is a function that returns an instance of cBase() ...
Function getStuff() As cBase()
I would like to be able to do the following ...
Dim lDummy As cChild = getStuff() ' This would implicitly call the
typecast operator
.... without having to do an explicit CType() ...
Dim lDummy As cChild = CType(getStuff(), cChild)
I remember that in C++ I could overload the casting operator. This
was not possible with .NET 1.1 2003 but I heard somewhere that it
could be done in .NET 2.0 2008.
Is there any way to do that?
Thanks,
Joe
I have the following scenario ...
Class cBase
End Class
Class cChild
Inherits cBase
End Class
Then there is a function that returns an instance of cBase() ...
Function getStuff() As cBase()
I would like to be able to do the following ...
Dim lDummy As cChild = getStuff() ' This would implicitly call the
typecast operator
.... without having to do an explicit CType() ...
Dim lDummy As cChild = CType(getStuff(), cChild)
I remember that in C++ I could overload the casting operator. This
was not possible with .NET 1.1 2003 but I heard somewhere that it
could be done in .NET 2.0 2008.
Is there any way to do that?
Thanks,
Joe