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

 

在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)重新编译,错误消失.

你可能感兴趣的:(import,compilation)