c++ - 错误 C2065 : 'DWORD_PTR' : undeclared identifier

标签 c++ windows

编译时

#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

我是否遗漏了任何包含内容。

最佳答案

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

假设您实际使用 MSVC 中的预编译 header 支持,这就是您的问题。您(尝试)在 stdafx.h 之前包含 windows.h之前 #include "stdafx.h" 的每一行代码都将被忽略。 IIRC MSVC 在某些版本中也给出了一些警告。

#include "windows.h" 放入stdafx.h 或将其移到#include "stdafx.h" 下方。

关于c++ - 错误 C2065 : 'DWORD_PTR' : undeclared identifier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3778090/

相关文章:

windows - 如何显示svn :external links in http browse repository

windows - 如何在Windows XP Embedded(未安装Sc.exe)上创建服务?

c++ - 如何在 Windows 上有效使用 PortAudio Pa_OpenStream()?

c++ - 线性搜索通过 vector[i] 得到 0ms 响应,而 vector.at(i) 得到时间

c++ - 高效获取 std::*_heap 的第二个元素

c++ - 如何在 Visual Studio Code 中使用 `pkg-config gtkmm-3.0 --cflags --libs`

c++ - Windows Unicode 键盘钩子(Hook)

c++ - 将函数对象传递给构造函数

c++ - 如何使用 Boost d_ary_heap?

windows - Git 检测到实际字节相同的已更改文件