COM/OLE/ActiveX/IDispatch 混淆
我无法理解这些术语之间的差异。
COM 和 ActiveX 是同义词吗?
ActiveX 对象只是公开 IDispatch 的 COM 对象吗?
许多旧的 MSDN 页面提到 IDispatch 时没有任何 COM 上下文。 它是否有单独的历史,并且是在其生命周期的后期在 COM“保护伞”下引入的?
OLE 适用于哪里? 它在 MFC 命名和 MSDN 中是否(相当大)存在 - 全部只是遗留问题?
维基百科提供了一些见解,但不多。 我找不到更深入的参考。
I can't wrap my head around the differences among these terms.
Are COM and ActiveX synonyms?
Is ActiveX object just a COM object that exposes IDispatch?
Lots of older MSDN pages mention IDispatch without any COM context. Does it have a separate history, and was just introduced under the COM 'umbrella' later in its lifecycle?
Where does OLE fit in? Is its (considerable) presence in MFC naming and MSDN in general - all just legacy?
Wikipedia gives some insight, but not much. I couldn't find a more in depth reference.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
找到了一些来自 COM 编程示例:
我仍然对最后一句话感到好奇 - COM 对象必须满足一些附加要求才能成为 ActiveX 控件吗? ——但这足以让它过去。
感谢您的回答!
Found some quotes from COM Programming by Example:
I'm still curious about the very last sentence - must a COM object satisfy some additional requirements to qualify as an ActiveX control? - but its enough to let it go.
Thanks for your answers!
ActiveX 是 COM 的营销术语,尽管 ActiveX 通常在作为 GUI 对象的“ActiveX 控件”上下文中使用。
IDispatch 是一个由 COM 对象实现的接口,以便客户端程序可以在运行时(后期绑定)动态调用其方法,而不是在编译时需要提前知道所有方法和参数类型。
OLE 是 COM 的早期版本。
ActiveX is marketing-ese for COM, although ActiveX is usually used in the context of "ActiveX controls" which are GUI objects.
IDispatch is an interface implemented by COM objects so that client programs can call its methods dynamically at run-time (late-binding), as opposed to at compile time where all the methods and argument types need to be known ahead of time.
OLE is the earlier version of COM.
关于 OLE:COM 源于 OLE。 但今天,OLE 可能被认为是构建在 COM 之上的,并且主要用于其名称所暗示的用途——文档链接和嵌入。 虽然 COM 本身只定义了几个接口(IUnknown、IClassFactory、IMalloc 等),但 OLE 添加了一大堆附加接口,如 IMoniker、IOleItemComtainer 等。
总而言之:COM 是基础,ActiveX 和 OLE 是顶层的COM。
Regarding OLE: COM has its roots in OLE. But today, OLE may be considered to be built on top of COM and is mostly used for what its name suggests -- document linking and embedding. While COM itself defines only a couple of interfaces itself (IUnknown, IClassFactory, IMalloc etc), OLE adds a whole bunch of additional interfaces like IMoniker, IOleItemComtainer, etc.
To sum up: COM is the foundation, ActiveX and OLE are layers on top of COM.