我试图创建一个栏列表与COM智能指针作为模板参数(_com_ptr_t
产生的包装类之一):是否有可能使用COM智能指针与分栏列表收集
CList<IDispatchPtr, IDispatchPtr> list;
使用普通指针时
error C2664: 'void __stdcall SerializeElements(class CArchive &,class _com_ptr_t<class _com_IIID<struct IDispatch,&struct __s_GUID _GUID_00020400_0000_0000_c000_00000000004 6> > *,int)' : cannot convert parameter 2 from 'struct IDispatch ** ' to 'class _com_ptr_t<class _com_IIID<struct IDispatch,&struct __s_GUID _GUID_00020400_0000_0000_c000_000000000046> > *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
它编译:但是我得到类似的几个编译错误:
CList<IDispatch*, IDispatch*> list;
望着调用SerializeElements它看起来像问题是,它需要一个TYPE *和有IDispatch** and IDispatchPtr*
之间没有转换的MFC代码。有没有办法解决?