When implementing several COM interfaces at once how do I upcast to IUnknown?

后端 未结 4 1211
野性不改
野性不改 2021-01-21 23:43

Suppose my COM object implements two or more COM interfaces:

class CMyClass : public IPersistFile, public IPersistStream {
};

when implementing

4条回答
  •  佛祖请我去吃肉
    2021-01-22 00:31

    Usually in cases where you want to cast to IUnknown an object with multiple inheritence from IUnknown, you cast it to one of its interface then cast to IUnknown...

提交回复
热议问题