EXE(进程外)COM 服务器是否可以免注册激活? [英] Is registration-free activation possible for EXE (out-of-process) COM servers?

查看:22
本文介绍了EXE(进程外)COM 服务器是否可以免注册激活?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我们可以使用 CoLoadLibrary 和 DllGetClassObject 来获取 IClassFactory 接口和获取 COM 组件接口,而无需注册 DLL.

I know that we can use CoLoadLibrary and DllGetClassObject to get the IClassFactory interface and get the COM component interface without registering the DLL.

但是 EXE 中的 COM 组件呢?有没有办法只提供不同的文件路径,就可以从 EXE 类型的 COM 服务器获取 COM 组件接口?

But what about a COM component in an EXE? Is there a way that I can get a COM component interface from an EXE-type COM server by just providing a different file path?

推荐答案

如果您使用 real 免注册 COM,您应该能够使其对进程内和进程外 COM 对象都有效.

If you use the real registration free COM, you should be able to get this working for both in-proc and out-of-proc COM objects.

正如 Sharptooth 所指出的,您实际上并没有使用免注册的 COM.相反,您实际上是通过伪造 COM 在激活期间使用的调用来实现自己的调用.如果您同时控制应用程序和要激活的 COM 服务器,您的解决方案就可以工作,但否则很可能会失败.

As Sharptooth pointed out, you're really not using registration free COM. Instead you're really rolling your own by faking the calls that COM uses during activation. Your solution CAN work if you control both your application and the COM server you're activating but it's likely to fail otherwise.

这篇关于EXE(进程外)COM 服务器是否可以免注册激活?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆