免费注册(Regfree)COM

发布于 2024-07-14 19:44:26 字数 299 浏览 4 评论 0原文

我们正在使用 COM 对象自动化模型来使我们的应用程序可供客户使用。

他们大部分使用 python 来访问我们的应用程序界面。

由于我们希望能够安装(尚未运行,这是另一个问题)应用程序的不同版本,因此我们正在将 COM 组件更改为 regfree。

但这与通过 IDispatch 自动化从脚本语言进行访问相冲突,因为它们需要注册表中的条目。

我们的方法是创建一个应用程序来管理实际应用程序的活动版本。 它让用户决定他想要哪个版本,并负责管理注册表项。

我们的方法有哪些替代方案?

We are using a COM Object automation model to make our application available to our customers.

They are using for the most part python to access our applicaton interface.

As we want to be able to install (not yet run, that's another issue) different versions of the application, we are changing our COM components to be regfree.

But that conflicts with the access from scripting languages through IDispatch automation since they need the entries in the registry.

Our approach is to create an application which manages the active version of our actual application. It lets the user decide which version he wants to have and it takes care of the registry entries.

What are the alternatives to our approach?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

各自安好 2024-07-21 19:44:26

COM 中有一个协议可以执行此操作。 如果您对接口进行版本控制(并更改每个版本的 GUIDS),则可以安装多个版本。 Microsoft 使用 WORD 等来执行此操作。

可以创建特定于库版本 5 的 Word.Document.5 类,或者只是创建机器上最高版本的实例的 word.Document。 我不确定此功能是否内置于 COM 中或是否需要实现,但值得研究。

There is a protocol within COM for doing this. If you version the Interfaces (and change the GUIDS for each version) you can install multiple versions. Microsoft does this with WORD etc.

It is possible to create a Word.Document.5 class which is specific to version 5 of the library, or just word.Document which will create an instance of the highest present on the machine. I'm not sure if this functionality is build into COM or needs to be impemented but it's worth looking into.

那伤。 2024-07-21 19:44:26

可以通过 Microsoft.Windows.ActCtx 访问 Regfree COM 对象 对象。

至于 IDispatch 自动化需要在注册表中输入条目——这并不完全正确。 我假设您正在使用默认的 ATL 实现 IDispatchImpl。
我们通过提供自己的实现 IRegFreeDispatchImpl 来解决此解决方案,该实现使用 激活上下文操作 API方式此处建议使用激活上下文激活/停用将所有入口点包装到 DLL 中。

Regfree COM objects can be accessed through the Microsoft.Windows.ActCtx object.

As for IDispatch automation requiring entries in the registry -- that's not strictly correct. I presume you're using the default ATL implementation, IDispatchImpl.
We solved this solution by providing our own implementation, IRegFreeDispatchImpl, which used the activation context manipulation APIs in the manner suggested here to wrap all entry points into the DLL with an activation context activation/deactivation.

染柒℉ 2024-07-21 19:44:26

好吧,答案是你自己建议的。 您可以编写一个应用程序,其中包含所有版本的 COM 组件的完整列表。 用户选择版本后,您可以调用 regsvr32 应用程序来注册该特定版本。

Well the answer is suggested by yourself. You can write an application which has complete list of all versions of COM components. Once a version is selected by user, you can call regsvr32 application to register that particular version.

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