I'm working through theForger's win32 tutorial, on two IDEs: Dev C++ and Visual Studio 2008. I try to duplicate results in both.
For this page of the tutorial, I can't seem to compile in Dev C++ (Visual Studio works fine). It's a modal dialog box. The code in question is in 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;
The error(s) it throws are:
Simple3\main.c In function `WndProc':
Simple3\main.c syntax error before "int"
Simple3\main.c `ret' undeclared (first use in this function)
If I define int ret;
before this point, it compiles, but a command window opens along with the regular app.
I assume I'm missing a header. The headers I'm using are windows.h
and afxres.h
. Could anyone help me out? Thanks in advance.
PS - real easy question while I'm at it - what's the difference between declaring headers in angle brackets or quotes? E.g. <windows.h>
or "windows.h"
?