Having installed Visual Studio .NET 2008 Service Pack 1 (installs Windows SDK 6.0a) and Windows SDK 6.1, I would obviously like to have newer Windows SDK used in include path. However after edit of WindowsSdkDir environment variable and checking all include directories to point to new Windows (former Platform) SDK path “C:\Program Files\Microsoft SDKs\Windows\v6.1“, MIDL compiler still looked for files in wrong directoty, why?
1>Microsoft (R) 32b/64b MIDL Compiler Version 7.00.05001>Copyright (c) Microsoft Corporation 1991-2006. All rights reserved. 1>Processing .\MyProject.idl 1>MyProject.idl 1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0a\include\dispex.idl 1>dispex.idl 1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0a\include\ocidl.idl 1>ocidl.idl ...
A quick check of devenv.exe process environment variables revealed mystic names _ACP_ATLPROV, _ACP_INCLUDE, _ACP_LIB, _ACP_PATH defined by Visual Studio environment itself and they don’t seem to be configurable through some file in Visual Studio directory.
However the solution came rather quickly. The older SDK directory has to be referenced from somewhere for the Visual Studio to pick it up. Installed Widnows SDK versions are listed in registry under key HKEY_CURRENT_USER\Software\Microsoft\Microsoft SDKs\Windows, a subkey for each version, and it was older SDK set to be current.
Once switched to new there, MIDL compiler started taking include files from proper directory.