COM/OLE/ActiveX/IDispatch 混淆

发布于 2024-07-18 02:17:35 字数 375 浏览 4 评论 0原文

我无法理解这些术语之间的差异。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

与之呼应 2024-07-25 02:17:35

找到了一些来自 COM 编程示例

您很快就会发现的另一件事
COM是营销实地考察
日与术语。 而不是
帮助促进理解,
你会发现在大多数情况下它会促进
神秘。 ... OLE、ActiveX、远程
对象 - 其中一个意味着什么
星期? ...

COM 是从解决方案演变而来的
具体问题-如何允许一个词
处理器来编辑电子表格
无需用户退出即可发送信件
文字处理器来做到这一点。 这
解决方案称为 OLE。 ... 然而,
随着 OLE (OLE2) 的第二个版本,
它的创建者将 OLE32.DLL 修改为
暴露更多基本功能
OLE 以便可以使用它的 API
允许任何应用程序访问
另一个的功能。 这个API,
自1993年以来没有太大变化,
被认为是 COM
API。
...

一旦 COM API 被公开,
微软用它来创造了
然后调用OLE控件来允许
复杂的控制(例如按钮
那个螺旋,播放的列表框
音乐)用 Visual C++ 编写
可通过 Visual Basic 访问
应用程序。 最终还是这个
技术被用来允许控制
由您的网站下载和使用
浏览器。 此时,名字
更改为 ActiveX 控件或只是
纯 ActiveX 纯粹用于营销
原因。 虽然你可以打包任何
ActiveX 控件中的功能,
它的要求是
专门用于支持用户
界面控制。

我仍然对最后一句话感到好奇 - COM 对象必须满足一些附加要求才能成为 ActiveX 控件吗? ——但这足以让它过去。

感谢您的回答!

Found some quotes from COM Programming by Example:

Another thing you'll quickly find with
COM is that marketing had a field trip
day with the terminology. Rather then
helping to promote understanding,
you'll find in most cases it promotes
mystery. ... OLE, ActiveX, Remotable
Objects - which one means what this
week? ...

COM evolved out of the solution to a
specific problem - how to allow a word
processor to edit the spreadsheet in a
letter without the user having to exit
the word processor to do it. This
solution was called OLE. ... However,
with the second release of OLE (OLE2),
its creators modified OLE32.DLL to
expose more of the basic functionality
of OLE so that its API could be used
to allow any application to acess the
functionality of another. This API,
which hasn't changed much since 1993,
is what is considered to be the COM
API.
...

Once the COM API was exposed,
Microsoft used it to create what were
then called OLE controls to allow
sophisticated controls (e.g., buttons
that spiral, list boxes that play
music) written in Visual C++ to be
accessible to Visual Basic
applications. Eventually this same
technology was used to allow a control
to be downloaded and used by your web
browser. At this point, the name
changed to ActiveX controls or just
plain ActiveX purely for marketing
reasons. Although you can package any
functionality in an ActiveX Control,
its requrirements have been
specialized for supporting a user
interface control.

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!

oО清风挽发oО 2024-07-25 02:17:35

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.

め七分饶幸 2024-07-25 02:17:35

关于 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文