#include "windows.h"
#include "stdafx.h"
#include "resource.h"
#include "ProgressDlg.h"
....
...
rItem.lParam = (LPARAM)(DWORD_PTR) m_lsStatusMessages.back().c_str();
我收到錯誤C2065:DWORD_PTR」:未聲明的標識符
我錯過任何包含。
#include "windows.h"
#include "stdafx.h"
#include "resource.h"
#include "ProgressDlg.h"
....
...
rItem.lParam = (LPARAM)(DWORD_PTR) m_lsStatusMessages.back().c_str();
我收到錯誤C2065:DWORD_PTR」:未聲明的標識符
我錯過任何包含。
如果我沒記錯的話,你至少需要一個定義。該basetsd.h
包含有類似
#if(_WIN32_WINNT >= 0x0400)
或
#if(WINVER >= 0x0502)
你可以給它一個鏡頭,並添加
#define _WIN32_WINNT 0x0501
#define WINVER 0x0501
您包括您windows.h
適用於Windows XP要求設置之前。
預處理器定義和Windows頭文件的概述可以找到 here。
嘗試與它但Dint幫助,我使用VC++ 6.0,如果它有幫助 – Simsons 2010-09-23 12:34:05
@Subhen:VC6早於引入DWORD_PTR。您將不得不手動更新平臺SDK才能獲取它。看到這裏:http://stackoverflow.com/questions/2723284/ – 2010-09-23 13:33:33
#include "windows.h"
#include "stdafx.h"
假設您實際使用MSVC中的預編譯頭支持,這是您的問題。您(嘗試)在stdafx.h
之前包含windows.h
。在#include "stdafx.h"
之前的代碼的每一行都被忽略。 IIRC MSVC在某些版本中也給出了一些警告。
可以將#include "windows.h"
置入stdafx.h
或將其移至#include "stdafx.h"
以下。
http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/0300699f-4f0d-46dc-9c47-c4f5f0a2356b/ – DumbCoder 2010-09-23 12:05:10