为了
this
教程的页面,我似乎不能在DeV C++中编译(VisualStudio工作得很好)。这是一个模态对话框。有问题的代码在
WndProc
:
case ID_HELP_ABOUT:
int ret = DialogBox(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDD_ABOUT),hwnd,AboutDlgProc); //ERROR OCCURS HERE in Dev C++
if(ret==IDOK) { MessageBox(NULL,"Dialog exited with OK","Notice",0); }
else { MessageBox(NULL,"Dialog exited with EXIT","Notice",0); }
break;
它抛出的错误是:
Simple3\main.c In function `WndProc':
Simple3\main.c syntax error before "int"
Simple3\main.c `ret' undeclared (first use in this function)
如果我定义
int ret;
在这之前,它会编译,但会打开一个命令窗口和常规应用程序。
我想我丢了一个头球。我用的标题是
windows.h
和
afxres.h
PS—我很容易问—用尖括号或引号声明标题有什么区别?例如。
<windows.h>
或
"windows.h"
?