现在的位置: 首页 > 综合 > 正文

error MIDL2025 : syntax error : expecting a type specification near “HRESULT”解决办法

2013年10月06日 ⁄ 综合 ⁄ 共 242字 ⁄ 字号 评论关闭

 

在vc6.0用ATL建立一个COM组件,然后在接口定义中加入方法,会遇到编译错误:

(1)error MIDL2025 : syntax error : expecting a type specification near "HRESULT"
(2)error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation 

 

解决办法:

(1)在加入的新接口的.odl文件头加上import "ocidl.idl",

(2)重新编译,错误消失.

抱歉!评论已关闭.