1、修改WINVER和_WIN32_WINNT
Visual C++ 不再支持面向 Windows 95、Windows 98、Windows ME、Windows NT 或 Windows 2000。 如果你的 WINVER 或 _WIN32_WINNT 宏分配給了這些 Windows 版本中的一個,則必須修改宏。 升級使用早期版本的 Visual C++ 創建的項目時,你可能會看到與 WINVER 或 _WIN32_WINNT 宏相關的編譯錯誤(如果這些宏分配給了不再受支持的 Windows 版本)。
備註:
若要修改宏,請在stdafx.h頭文件中添加以下行。
#define WINVER 0x0602 #define _WIN32_WINNT 0x0602
此版本面向 Windows 8 操作系統。 其他有效值包括適用於 Windows XP 的 0x0501、適用於 Windows Server 2003 的 0x0502、適用於 Windows Vista 的 0x0600、適用於 Windows 7 的 0x0601、適用於 Windows 8 的 0x602,以及適用於 Windows 8.1 的 0x603。