如何将COM指针从一个进程传递到另一个进程?

发布于 2024-09-29 05:06:28 字数 175 浏览 2 评论 0原文

我有一个指向进程 1 中的 COM 对象的接口指针。我想从另一个进程访问同一对象。我怎样才能达到这个目的?我相信由于地址空间不同,直接传递指针是行不通的。我知道它涉及编组/代理/存根内容。但我不知道细节。

有人可以提供一些有关要遵循的步骤和要调用的函数的详细说明吗?多谢。我不是 COM 对象本身的设计者。我只是在用它。

I have an interface pointer to an COM object sitting within process 1. I would like to get access to the same object from another process. How can I achieve this purpose? I believe directly passing over the pointer wouldn't work due to different address spaces. I know it involves the marshaling/proxy/stub stuff. But I don't know details.

Can somebody provide some detailed instructions regarding the steps to follow and the functions to call? Thanks a lot. I am not the designer for the COM object itself. I am just using it.

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

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

发布评论

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

评论(1

寂寞陪衬 2024-10-06 05:06:28

您必须了解 COM 的基础知识才能完成这项工作。基本上,进程 1 是客户端的进程外服务器(第二个进程)。 此处,尤其是获取指向对象的指针< /a>.

You are going to have to understand the basics of COM to make this work. Basically process 1 is an out-of-proc server for your client (the second process). Take a dig around in the COM docs here, especially Getting a Pointer to an Object.

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