We're looking into moving our application from VS2008 to VS2010.
We generate some COM objects with "attributed programming" and the IDL is automatically generated.
The import directives for both files are different and the compilation fails on VS2010.
on VS2008, it generates something like :
import "docobj.idl";
on VS 2010
import "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\wincrypt.idl";
import "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\exdisp.idl";
import "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\shldisp.idl";
import "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\prsht.idl";
import "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\mshtmhst.idl";
import "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\mshtml.idl";
import "c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dimm.idl";
import "c:\program files (x86)\microsoft sdks\windows\v7.0a\include\dispex.idl";
When the IDL is compiled on VS2010 it generates the following errors
20> Microsoft (R) 32b/64b MIDL Compiler Version 7.00.0555
20> Copyright (c) Microsoft Corporation. All rights reserved.
20> Processing .\_my_idl.idl
20> _my_idl.idl
20> Processing C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\wincrypt.idl
20> wincrypt.idl
20>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\wincrypt.idl(47): error MIDL2025: syntax error : expecting a type specification or a storage specifer or a type qualifier near "WCHAR"
20>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\wincrypt.idl(47): error MIDL2026: cannot recover from earlier syntax errors; aborting compilation
20>LINK : fatal error LNK1240: failed to compile IDL content
manually removing the "wincrypt.idl" import directive removes the compilation error, but that's not a solution since the idl is auto generated.
I'm not certain why the two IDL are different and what is responsible to add the import directives; or even how to fix the MIDL compilation error.
Any ideas ?
Thanks in advance.
Max.