tags:

views:

80

answers:

3

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 getting the error C2065: 'DWORD_PTR' : undeclared identifier

Am I missing any Includes.

+1  A: 

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

Brian R. Bondy
My not be the answer. http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/0300699f-4f0d-46dc-9c47-c4f5f0a2356b/
DumbCoder
@Brian R. Bondy, Included the windows.h , Edited the question with updates
Subhen
A: 

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.

Tried with it but Dint help , I am using VC++ 6.0 , If it helps at all
Subhen
@Subhen: VC6 predates the introduction of DWORD_PTR. You would have to manually update the platform SDK to get it. See here: http://stackoverflow.com/questions/2723284/
Charles Bailey
+1  A: 
#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".

wilx