How to return inherited class types from function?
I'm having a problem (in fact it is not an issue I can direct cast or safe cast) about one structure.
I have classes like below: All Class1 to Class5 inherited from ClassA and I have one function which is not created by myself returns type ClassA. Now I wonder is there any way to return any of the inherited (Class1,..., Class5) type desired class?
This is the function that cannot be modified because it comes from the COM interface