需要澄清COM规范 [英] COM specifications need to be clarified
问题描述
问候,
我需要了解一些COM规范和术语。我在这里读了一篇关于COM的好文章, COM简介 - 它是什么以及如何使用它,然而,我仍然不理解的东西很少,我希望有人可以帮助我。首先文章指出
Greetings,
I need to know about some COM specifications and terminologies. I read a good article here about COM, Introduction to COM - What It Is and How to Use It, however, there are few things I still do not understand and I hope that someone could help me in that. Firstly the article states that
接口不允许多重继承
另一方面,文章中提到了一个方法IUnknown接口名为
On the other hand, the article mentioned a method on the IUnknown interface called
QueryInterface()
QueryInterface()
如果对象的类实现更多,它可用于从COM对象请求指针比一个界面。所以我很困惑是从多个接口继承(即类:interface1,interface2等等)是允许/不允许的?!!!我们还将接口类型的指针传递给CoCreateInstance()方法以及类名作为多态的形式,因为可能有多个类在其中实现相同的接口?这是前两个问题
我尝试过:
在论坛上阅读有关COM的文章,了解什么是COM对象
which can be used to request a pointer from a COM object if the object's class implements more than one interface. So I am confused is inheriting from multiple interfaces (i.e., class : interface1, interface2, etc...) is allowed/not allowed?!!!. Also do we pass a pointer of interface type to the CoCreateInstance() method along with the class name as a form of polymorphism as there may be multiple classes each implement the same interface in its on way?. Those are the first two questions
What I have tried:
Read an article about COM on the forum to understand what are COM objects
推荐答案
COM
界面不是C ++
interface(COM
'class'不是C ++
'class'如文章所述)。看一下 COM对象和接口(COM) [ ^ ]。COM
类可能会暴露多个接口,但不会隐含任何接口多重继承。
COM
interface is notC++
interface (COM
'class' is notC++
'class' as stated in the article). Have a look at COM Objects and Interfaces (COM)[^]. ACOM
class may expose multiple interfaces, but no interface multiple inheritance is implied in that.
这篇关于需要澄清COM规范的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!