C++头文件错误?
问题描述:
(Visual Studio的C++ 6.0)C++头文件错误?
.\app.h(69) : error C2146: syntax error : missing ';' before identifier 'IsProcessRunning'
.\app.h(69) : error C2501: 'DWORD' : missing storage-class or type specifiers
.\app.h(69) : error C2061: syntax error : identifier 'LPCTSTR'
.\app.h(70) : error C2061: syntax error : identifier 'LPCTSTR'
不知道为什么这些错误?为什么语法错误? DWORD和LPCTSRT被认可。
virtual BOOLEAN DoNew(void);
DWORD IsProcessRunning(LPCTSTR procname);
bool TerminateProcess(LPCTSTR procname);
void UpdateControllerStatus(void);
答
根据错误,DWORD无法识别。你确定你包含windows.h吗?
答
将#include添加到代码的开头...
您忘记了包含DWORD和LPCTSTR的定义;可能缺少#include –
pjc50
它是在cpp中,但是当我在这个头文件中包含windows.h时,比在Windows自己的头文件中有更多1000个错误。 – jdl