R
Random
I'm trying to find the method I need to explicitly cast a class to a type of
one of the classes that inherits from it. I'm passing in the type of the
class I want to cast to as a parameter of my method, but the procedure
doesn't me using this. Here's the simplified code....
----------------------
Public Class MyClass
....
End Class
Public Class MyDerivedClass
Inherits MyClass
....
End Class
Public Shared Function GetClass(ByVal classType As MyClass) As MyClass
dim sC As MyClass = New MyClass()
Return CType(sC, classType)
End Function
one of the classes that inherits from it. I'm passing in the type of the
class I want to cast to as a parameter of my method, but the procedure
doesn't me using this. Here's the simplified code....
----------------------
Public Class MyClass
....
End Class
Public Class MyDerivedClass
Inherits MyClass
....
End Class
Public Shared Function GetClass(ByVal classType As MyClass) As MyClass
dim sC As MyClass = New MyClass()
Return CType(sC, classType)
End Function