诸如CopyFileEx
这样的函数在使用的时候可能会碰到明明是包含在头文件里的函数但编译不过去,显示如下:
error C2065: 'CopyFileEx' : undeclared identifier
error C2065: 'COPY_FILE_RESTARTABLE' : undeclared identifier
解决方法如下:
For example, to use the features specifically marked for Windows 2000 in the header files, you need to explicitly define _WIN32_WINNT as 0x0500 or greater. You can define the symbols using the #define statement in each source file, or by specifying the /D_WIN32_WINNT=0x0500 compiler option supported by Visual C++.
#define _WIN32_WINNT 0x0500
#include <windows.h>
一定要在头文件<windows.h>之前