-
Dialog boxes in Dev-C++
I have Dev-C++ 4 and am using Windows 98. I have a project I was going to add a dialog box to and added this code to the resource file:
Code:
IDD_ABOUT DIALOG DISCARDABLE 0, 0, 239, 66
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "My About Box"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "&OK",IDOK,174,18,50,14
PUSHBUTTON "&Cancel",IDCANCEL,174,35,50,14
GROUPBOX "About this program...",IDC_STATIC,7,7,225,52
END
I was going to make it have more text but this code wouldn't work. I hit build resource and it said it had an error in line 2, being the line where i define the STYLE. Those are perfectly acceptable styles so why is it causing an error? Thanks.
-
Did you include #include <windows.h> in your .rc?
-
Nope I didn't and that was the problem, thanks a lot.
-
There are one of many problems that you could have here, since you didn't bother to post the error. Did you add "resource.h" to your main window file, did you add "resource.h" and "windows.h" to the resource file? Is resource_private pointing to resource.rc?? Did you even put the dialog in creating the window, there are many of plenty problems if you don't state it.
-
Uhh no, thanks but the only problem I had was I forgot to include windows.h. Just a stupid mistake.