开发者

error C2065: 'DWORD_PTR' : undeclared identifier

While compiling

#include "windows.h"
#include "stdafx.h"
#include "resource.h"
#include "ProgressDlg.h"
    ....  
    ...  
rItem.lParam   = (LPARAM)(DWORD_PTR) m_lsStatusMessages.back().c_str();

I am ge开发者_开发百科tting the error C2065: 'DWORD_PTR' : undeclared identifier

Am I missing any Includes.


#include "windows.h"
#include "stdafx.h"

Assuming you actually use the precompiled headers support in MSVC, this is your problem. You (try to) include windows.h before stdafx.h. Every line of code before #include "stdafx.h" is ignored. IIRC MSVC also give some warning about it in some versions.

Either put the #include "windows.h" into stdafx.h or move it below #include "stdafx.h".


DWORD_PTR is defined in basetsd.h but you should include windows.h


If I remember correctly, you need at least one define. The basetsd.h contains something like

#if(_WIN32_WINNT >= 0x0400)

or

#if(WINVER >= 0x0502)

You can give it a shot and add

#define _WIN32_WINNT 0x0501
#define WINVER 0x0501

before you include your windows.h for Windows XP requirement settings.

An overview on preprocessor defines and windows header files can be found here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜