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

后端 未结 4 1210
野性不改
野性不改 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:30

    It doesn't matter which upcast you use, only that you use the same one always. I'd just pick a convention, such as always returning the first one declared in the inheritance list.

提交回复
热议问题