错误 1 error C2787: “LogLevel”: 没有与该对象关联的 GUID h:\office_dcs\trunk\XXXX\debug\msado15.tlh208
错误 2 error C3203: “_com_IIID”: 未专用化的类 模板 不能用作 模板 变量,该变量属于 模板 参数“_IIID”,应为 real 类型h:\office_dcs\trunk\XXXX\debug\msado15.tlh208
错误 3 error C2955: “_com_IIID”: 使用类 模板 需要 模板 参数列表 h:\office_dcs\trunk\XXXX\debug\msado15.tlh 208
错误 4 error C2079: “Errors::GetItem”使用未定义的 class“_com_ptr_t”h:\office_dcs\trunk\XXXX\debug\msado15.tli172
错误 5 error C2955: “_com_ptr_t”: 使用类 模板 需要 模板 参数列表 h:\office_dcs\trunk\XXXX\debug\msado15.tli 176
解决方法类似:
实现IContextMenu出现C2787错误:“IContextMenu”:没有与该对象关联的GUID
From: http://community.csdn.net/expert/Topicview2.asp?id=4853965
A:There are two <comdef.h> header files in VC.NET, one in Vc7/include and the other in Vc7/PlatformSDK/include. The former splits off the smart pointer typedefs into comdefsp.h, and it doesn't include IContextMenu. The latter does. You can try to #include the PlatformSDK header directly, change your INCLUDE path order, or supply the missing typedef yourself
即:改变头文件包含顺序,把ado的处理文件头放在所有包含头文件前面