fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0500. Value 0x0501 or higher is recommended.
Today i upgraded my Visual Studio 2008 MFC app to Visual Studio 2010 and got the following error message when i compiled it for the first time
fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0500.
Value 0x0501 or higher is recommended.
After figuring out the problem i would like to share it with you guys so it might save some of your precious time
Open stdafx.h file in your visual studio project and change to below values to fix the problem
#ifndef WINVER
#define WINVER 0x0501
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
#ifndef _WIN32_WINDOWS
#define _WIN32_WINDOWS 0x0501
#endif
#ifndef _WIN32_IE
#define _WIN32_IE 0x0500
#endif
Let me know if you find it useful