如何将COM指针从一个进程传递到另一个进程?
我有一个指向进程 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须了解 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.