出現
error C1189:#error:This file requires _WIN32_WINNT to be #defined at least to 0x0403是由於原工程與現在你的系統不相容導致的,一般是原工程的版本較低,現在的版本較高,不能相容。糾正方法是:首先 找到stdafx.h標頭檔(一般標頭檔定義都在這裡,首選就是找這裡),前3段是關於系統的(幹涉,此處就是系統不相容,所以全部注釋掉),最後1段是講IE的(不干涉,預設處理) 注釋掉前3 個低版本的//#ifndef WINVER
// Allow use of features specific to Windows 95 and Windows NT 4 or later.
//#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
//#endif
//
//#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
//#define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
//#endif
//
//#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
//#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
//#endif2 添加新的本本
#define WINVER 0x0500
#define _WIN32_WINNT 0x0500
#ifndef WINVER // 允許使用特定於 Windows XP 或更高版本的功能。
#define WINVER 0x0501 // 將此值更改為相應的值,以適用於 Windows 的其他版本。
#endif
3 下面這個是IE的不用管
#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later.
#define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later.
#endif
這樣就不會出錯了