在头文件中的类定义中添加如下代码:
public IObjectSafetyImpl<CICCardOperate,INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA>,
如class ATL_NO_VTABLE CICCardOperate :
public IObjectSafetyImpl<CICCardOperate,INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA>,
public CComObjectRootEx<CComSingleThreadModel>,
.......
同时在BEGIN_COM_MAP(CICCardOperate)下面添加:
COM_INTERFACE_ENTRY(IObjectSafety)
完成后重新编译