通过使用in-proc-server导出out-of-proc COM服务器的子集 [英] Exporting a subset of a out-of-proc COM server by using an in-proc-server

查看:351
本文介绍了通过使用in-proc-server导出out-of-proc COM服务器的子集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实现了一个out-of-proc COM服务器(在服务中实现)。我不想让其他应用程序访问COM服务器中的所有功能,所以我开发了一个内部服务器(DLL),它将与外部服务器通信。

I implemented an out-of-proc COM server (implemented in a Service). I don't want other applications to access all the functionality in the COM server, so I developed an in-proc server (DLL) which would talk to the out-of-proc server.

因为我不想直接访问out-of-proc COM服务器中的接口,我不嵌入类型库与服务,所以我想我可以使用#import,并有权访问COM服务器通过TLB。但是,当我在我的in-proc-server中创建一个在服务中实现的类的实例时,我得到一个E_NOINTERFACE。我想这是由于编组,但我不知道如何克服这一点。

Because I don't want the interfaces in the out-of-proc COM server to be accessed directly, I don't embed the type library with the Service so I thought I could use #import and have access to the COM server through the TLB. However, when I try in my in-proc-server to create an instance of a class implemented in the service, I get an E_NOINTERFACE back. I guess this is due to marshalling, but I couldn't figure out how to overcome this.

任何想法如何沟通从in-proc服务器与我out-of-proc服务器,而不暴露out-of-proc服务器的接口详细信息?

Any idea on how to communicate from the in-proc-server with my out-of-proc server without exposing the interface details of the out-of-proc server?

推荐答案

关于这将如何帮助conseal接口,但有三种方式使编组工作和typelib是其中之一。另一个很容易的方法是一个代理/存根 - 在一个单独的in-proc COM服务器中的一堆代码,将在Windows注册表中注册后自动执行编组。再次,我不知道这将如何帮助conseal接口,但它看起来更隐蔽,然后一个类型库,只是暴露的界面给任何人与OLEView。

I'm not sure about how this will help to conseal the interfaces, but there're three ways to make marshalling working and typelib is one of them. The other quite easy way is a proxy/stub - a bunch of code in a separate in-proc COM server that will automagically do the marshalling once it has been registered in Windows registry. Again, I'm not sure how this will help conseal the interface, but it looks more covert then a type library that just exposes teh interface to anyone with OLEView.

这篇关于通过使用in-proc-server导出out-of-proc COM服务器的子集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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