如何编写类似于运行对象表(ROT)的WCF服务?
我正在尝试编写 运行对象表,如 WCF 服务 (.NET 4.0),用于跨进程提供对某些 COM 控件的访问。该服务可由 COM 和 .NET 客户端访问。
我选择 WCF 是因为它被推荐用于进程间通信,而且我还认为如果我不必依赖于我没有太多控制权的 ROT,那会很好。
解决了几个问题后,我遇到了障碍。我不知道如何通过服务传递 COM 控制并将其返回给客户端。该对象永远不会到达服务。尽管建议将 WCF 用于 IPC,但它不提供对传递 COM 对象的开箱即用支持。到目前为止我还没有找到任何解决方案。可能 WCF 服务不是替换运行对象表的正确方法。但我没有看到更好的 IPC 方法。
对此有何建议?
I am trying to write a running object table like WCF service (.NET 4.0) for providing access to some COM controls across processes. This service is accessed by both COM and .NET clients.
I chose WCF since it is recommended for inter-process communication and I also thought it would be good if I don't have to depend on ROT where I don't have much control over.
After solving several hiccups, I reached a road block. I don't know how to pass the COM control through the service and give it back to a client. The object never reaches the service. Though WCF is recommended for IPC, it does not provide out of the box support to pass COM objects. I also haven't found any solutions so far. May be WCF service is not the right approach to replace running object table. But I don't see a better way to do IPC.
Any suggestions on this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
COM objref 无法在 WCF 消息中传递(好吧,我想您可以在接收器大小上创建一个 MEOW 解释器并使用 CoMarshalInterThreadInterfaceInStream 来传递 objref)
但是,您可以将对象放入 GIT 中并传递 GIT cookie大约
A COM objref can't be passed around in a WCF message (well I guess you could create a MEOW interpreter on the receiver size and use CoMarshalInterThreadInterfaceInStream to pass the objref)
However, you could put the objects in the GIT and pass the GIT cookies around
但是我们可以通过实现 IUNKNOWn 接口直接将 COM 对象放入 ROT 中
But we can directly place COM object into the ROT by implementing IUNKNOWn interface