Hey there,
I've got a bit a strange problem. Which means I think I already know the reason, but I do not see any way around it ^^.
But let me descripe. Basicly I've got an simple interface inherting from IUnknown:So far so good. Now I want to inherit many other interfaces from this interface so that a method can use different special methods of this interface later on dynamicly in the code:Code:[ object, ... ] interface IMyInterface : IUnknown { }Everything works fine, until I e.g. call QueryInterface of a special class to get an pointer to the base interface:Code:[ object, ... ] interface ISpecialInterface1 : IMyInterface { } [ object, ... ] interface ISpecialInterface2 : IMyInterface { } // ...Somehow I allways get an AccessViolation Exception or an InvalidCast Exeption. I guess it is because I do not implement IMyInterface so it stays abstract. But usually this is the idea behind an interface. I allways thought the methods are pointers to the real implementations of the methods, but... I don't know ^^.Code:STDMETHODIMP ISpecialInterface2::GetInterface(/* [out, retval] */ IMyInterface** Interface) { this->QueryInterface(IID_IMyInterface, reinterpret_cast<void**>(Interface)); return S_OK; }
Any solutions?
Thank you,
- Aschratt.





Reply With Quote