VS2005项目升级到VS2008项目时出现错误MIDL2025,错误MIDL2026 [英] error MIDL2025, error MIDL2026 while upgrading the VS2005 project into VS2008 project

查看:166
本文介绍了VS2005项目升级到VS2008项目时出现错误MIDL2025,错误MIDL2026的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目(内部使用COM组件),并且在VS 2005环境中构建良好.当我尝试将同一项目升级到VS2008时,出现以下错误:

错误MIDL2025:语法错误:预期]或注释"附近,
错误MIDL2026:无法从早期的语法错误中恢复;正在中止编译,
NMAKE:致命错误U1077:.\ midl.EXE":返回代码"0x7ea"和
:错误PRJ0019:工具从执行Makefile项目操作"中返回了错误代码.

错误2025和2026指出了Unknown.idl @ C:\ Program Files \ Microsoft SDKs \ Windows \ v6.0A \ include中的以下代码段

HRESULT QueryInterface(

[ in ] REFIID riid ,

> [ out <字体颜色=#0000ff" size = 2> <字体颜色=#0000ff" size = 2> id_is (riid),注释( " __ RPC__deref_out" )] void ** ppvObject);


我有以下疑问

1)为什么Visual Studio 2008指向Microsoft SDKs文件夹而不是IDL文件的Microsoft Visual Studio 9.0 \ VC?

我们不想指向这些idl
文件的C:\ Program Files \ Microsoft SDK,因为我们不确定客户端是否具有Microsoft SDK v6.0A
版本.我们必须指向"Microsoft Visual Studio 9.0&".用于VS2008项目.该怎么做?

2)如果在2008年删除了C:\ Program Files \ Microsoft Visual
Studio 9.0 \ VC下的PlatformSDK文件夹,我看不到该文件夹​​?

要知道COM项目的行为,我在Visaul Studio 2008中创建了一个简单的COM ATL项目,发现
生成的idl文件正在自动导入IDL文件(OAIDL.IDL,OBJIDL.idl等)
文件并将其指向C:\ Program Files \ Microsoft SDK \ Windows \ v6.0A \\ include \ oaidl.idl.

当我在Visaul Studio 2005中创建相同的项目时,以上文件指向C:\ Program Files \ Microsoft Visual Studio 8 \ VC \ PlatformSDK \ Include.为什么会这样?


非常感谢您提供任何帮助

在此先感谢您,


问候,
GangaRaju G

解决方案

表示这些MIDL设置不是由Visual Studio正确设置或保存的.仔细检查这些设置是否正确,然后重新编译以解决此问题.



请注意,
dumpala.ram


Hi,

 

I have one project (which is internally using COM components) and built fine in VS 2005 environment. When I'm trying to upgrade the same project into VS2008, I got the following errors:

error MIDL2025 : syntax error : expecting ] or , near "annotation", 
error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation ,
NMAKE : fatal error U1077: '.\midl.EXE' : return code '0x7ea' and
: error PRJ0019: A tool returned an error code from "Performing Makefile project actions".

errors 2025 and 2026 are point outing the following secton of code in Unknown.idl @ C:\Program Files\Microsoft SDKs\Windows\v6.0A\include

HRESULT QueryInterface(

[in] REFIID riid,

> [out, id_is(riid), annotation("__RPC__deref_out")] void **ppvObject);


and i have following doubts

1)  Why visual studio 2008 is pointing to Microsoft SDKs folder instead of
 Microsoft Visual Studio 9.0\VC for idl files? 

        we don't want to point to C:\Program Files\Microsoft SDKs for these idl
 files because we are not sure whether client have Microsoft SDKs v6.0A
 version. We have to point to "Microsoft Visual Studio 9.0" for VS2008 project. how to do this?

 

2) I do not see PlatformSDK folder under C:\Program Files\Microsoft Visual
Studio 9.0\VC, if this is removed in 2008 ?

        To know the COM project behaviour, I created a simple COM ATL project in Visaul Studio 2008 and found that
the generated idl file is automatically importing IDL files (OAIDL.IDL, OBJIDL.idl etc)
files and pointng to C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\oaidl.idl.

        when i created the same project in Visaul Studio 2005 the above files are pointing to C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include. why it is behaving like this?


Any help is greatly appreciated

Thanks in advance


Regards,
GangaRaju G

解决方案

after compiling you see this error "error MIDL2025 : syntax error : expecting ] or , near "annotation" " it indicates that these MIDL settings were either not properly set or saved by Visual Studio. Double check that these settings are correct and re-compile to fix the issue.



regards,
dumpala.ram


这篇关于VS2005项目升级到VS2008项目时出现错误MIDL2025,错误MIDL2026的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆