I have a problem with a cast two objects in .Net Compact framework but the same problem doesn't occur in .net. I have an Interface InterfaceA
that inherits an interface InterfaceB
. Later I have a method that get Interface InterfaceB
and returns Interface InterfaceB
When I pass in an object of an implementation of the InterfaceA
interface to InterfaceB
, I guet the values passed in without problem. However when I cannot get the values returned from the methods because I get a casting error.
Can some one help with this?
public InterfaceB methodA (InterfaceB param)
//do some work
InterfaceA object1 = (Interface)methodA(object1);