-
resource error
in my resource file my compiler Dev C++ 5, says there is a syntax error. But i can't see any at all.
Code:
MyDB DIALOG 18, 18, 142, 92
CAPTION "Test Dialog Box"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
{
DEFPUSHBUTTON "Red", IDD_RED, 32, 40, 30, 14
WS_CHILD | WS_VISIBLE | WS_TABTOP //error line
PUSHBUTTON "Green" IDD_GREEN, 74, 40, 30, 14,
WS_CHILD | WS_VISIBLE | WS_TABTOP
PUSHBUTTON "Cancel", IDC_CANCEL, 52, 65, 37,14
WS_CHILD | WS_VISIBLE | WS_TABTOP
}
Non of the lines below have an error and i copied and pasted them to that line, and it still says that there is an error.
-
You missed a comma before the 14 on the red and cancel buttons, along with in several other places.
Here is the fix:
Code:
MyDB DIALOG 18, 18, 142, 92
CAPTION "Test Dialog Box"
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
{
DEFPUSHBUTTON "Red", IDD_RED, 32, 40, 30, 14,
WS_CHILD | WS_VISIBLE | WS_TABTOP //error line
PUSHBUTTON "Green", IDD_GREEN, 74, 40, 30, 14,
WS_CHILD | WS_VISIBLE | WS_TABTOP
PUSHBUTTON "Cancel", IDC_CANCEL, 52, 65, 37,14,
WS_CHILD | WS_VISIBLE | WS_TABTOP
}
-
now i've fixed that error it brings up this. I'm sure there is no error though.
Code:
MyMenu MENU
{
POPUP "&Dialog"
{
MENUITEM "Dialog &1", IDM_DIALOG1
MENUITEM "Dialog &2", IDM_DIALOG2
MENUITEM "E&xit", IDM_EXIT
}
MENUITEM "&Help", IDM_HELP
}
MyMenu ACCELERATORS
{
VK_F2, IDM_DIALOG1, VIRTKEY
VK_F3, IDM_DIALOG2, VIRTKEY
"^x", IDM_EXIT
VK_F1, IDM_HELP, VIRTKEY
}
-
#include windows.h at the top of your .rc.