Thanks for the help all.
Hmm, drat, I didnt test the whole execution before thanking you Tim, serves me right for staying up into the wee hours. It compiles and runs. but I get IllegalCastException (Car cannot be cast to Tesla) when its called.
Dim oTesla As Tesla = Tesla(Car.Start()) <-- IllegalCastException (Car cannot be cast to Tesla)
I dont have access to Car, its a class from a plugin.
[code]Class Car
Shared Sub Start() as Car
Sub
End Class
Class Tesla
Inherits Car
Shared Sub Start() as Tesla
return Tesla(Super.Start()) <-- IllegalCastException (Car cannot be cast to Tesla)
Sub
End Class[/code]
Basically, I need to create a Class that I can pass the Car returned by Car.Start
This class would then let me use the events etc raised by Car.
I was trying to keep it abstract to keep it simple but everyone is assuming that I have control over Car and the return values from Car.Start which I dont. Maybe this would be easier without all the abstraction…
Car is Chilkat.Socket
Start is AcceptNextConnection
Chilkat.Socket.AcceptNextConnection returns a new Chilkat.Socket
aka
Car.Start returns a new Car
I created a Class as follows
Class TCPConnection
Inherits Chilkat.Socket
End Class
I want to somehow assign the Chilkat.Socket returned from AcceptNextConnection to my TCPConnection class so I can then create the functionality in that class to deal with the socket, events etc.
I could drop the Super in TCPConnection and just connect things up manually with AddHandler inside TCPConnection but I was wondering if there was a way without doing this.