From: Alf P. Steinbach on
* glitteringsounds:
> Hello,
> I have to compile COM components written in VC 6.0 or edited and
> modified in Visual Studio 2003 in Visual Studio 2010. It is giving
> error messages like
>
> ' error C1189: #error : This file requires _WIN32_WINNT to be
> #defined at least to 0x0403. Value 0x0501 or higher is recommended'
>
> IntelliSense: #error directive: This file requires _WIN32_WINNT to be
> #defined at least to 0x0403. Value 0x0501 or higher is recommended'
>
> It given the error in the conversion report that atl support is
> eliminated.Can any body tell a way around to compile and build COM
> components that were originally written in VC 6.0 or Visual Studio
> 2003.NET

For the immediate problem, just define _WIN32_WINNT. It's used by <windows.h> to
include only declarations that are meaningful for the specified Windows version
and lower. 0x0500 is Windows 2000, 0x0501 Windows XP, and I think but not sure
that 0x0502 would be Windows Server (?). Based on this progression,
hypothetically Vista would be 0x0600 and Windows 7 perhaps 0x0700?

Someone more knowledgable than me (or willing to invest perhaps half a minute
googling) will perhaps chime in with more complete details.

I'd go for 0x0500, using Windows 2000 features but not later.

If you have a stdafx.h file you can probably define it there, or just define it
in the project settings.

You'll probably discover other problems when this one's fixed.


Cheers & hth.,

- Alf
From: Bob Smith on
On 2/16/2010 7:34 AM, Alf P. Steinbach wrote:
>> IntelliSense: #error directive: This file requires _WIN32_WINNT to be
>> #defined at least to 0x0403. Value 0x0501 or higher is recommended'
[...]
> For the immediate problem, just define _WIN32_WINNT. It's used by <windows.h> to
> include only declarations that are meaningful for the specified Windows version
> and lower. 0x0500 is Windows 2000, 0x0501 Windows XP, and I think but not sure
> that 0x0502 would be Windows Server (?). Based on this progression,
> hypothetically Vista would be 0x0600 and Windows 7 perhaps 0x0700?
>
> Someone more knowledgable than me (or willing to invest perhaps half a minute
> googling) will perhaps chime in with more complete details.
>
> I'd go for 0x0500, using Windows 2000 features but not later.

FWIW: Look in the file sdkddkver.h for the meanings of _WIN32_WINNT
constants and other related #defines.

--
_________________________________________
Bob Smith -- bsmith(a)sudleydeplacespam.com

To reply to me directly, delete "despam".