以前学的时候好像记得,对于一些只使用了VARIANT中的类型的接口不需要自己的proxy stub,windows有一个缺省的proxy stub可以使用。我的问题是如果我的接口方法中使用了另一个我自己定义的接口作为参数,那么这时需不需要自己的proxy stub?如下interface IMyInterface;interface IMyInterface2
{
....
HRESULT GetInterface(IMyInterface** ppInterface);
}当创建实现了IMyInterface2的组件时需不需要同时创建其proxy stub?还是使用windows缺省的那个就可以了?
{
....
HRESULT GetInterface(IMyInterface** ppInterface);
}当创建实现了IMyInterface2的组件时需不需要同时创建其proxy stub?还是使用windows缺省的那个就可以了?
进程外的每个接口函数都要proxy/stub
本地调用其它本地接口只需要在IDL中定义即可
To expose nonremotable interfaces, a custom surrogate can inject a wrapper between the client and inproc object that can custom marshal into the client's apartment.
To implement nonstandard process/object lifetime semantics (such as shutting down idle servers or objects).
To spread the instances of an STA-only CLSID across multiple STA threads to increase concurrency for SMP machines. For an example of this, please see http://www.develop.com/dbox/com/surrogates/aptsur.htm.
To make the surrogate use hardwired security settings independent of what the administrator has configured using DCOMCNFG.EXE.
To play tricks on the client and swap in a different CLSID (or perhaps host machine) based on some dynamic state that your surrogate can monitor.