开发者

Upcasts in COM automatic?

I开发者_如何学编程n COM, if I have an interface IBase and an interface IX which inherits from IBase, can I call methods of IBase through an IX pointer, and if not, why can I call Release() and AddRef() on any COM interface pointer without an upcast?


Yes, you can call whatever method of the base through the pointer to the derived. That's exactly why you can call AddRef(), Release() and QueryInterface() through any interface pointer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜