Click to See Complete Forum and Search --> : Dialog resource syntax error


Reaem
March 20th, 2006, 11:52 PM
I'm a complete newbie when it comes to windows api and resource files. During my attempts to learn and create my own program, I came accross a problem trying to create a single dialog. This is a dialog resource in my resource.rc file in which I get a syntax error anytime i put something between BEGIN and END. No matter what it is I put there, I get a "syntax error", if I comment the whole thing out, the program compiles fine. Any of these lines individually will cause a compiler syntax error if un-commented.
For the life of me I can't figure out why, I've tried changing the size and locations of all the buttons and text, of the window itself, and lots of other misc changes to try to fix it or isolat ethe problem, with no success. If anyone can tell me what I did wrong here I'd appreciate it.
Using dev-c++:

IDD_EMPLOYEE DIALOG DISCARDABLE 800,800,800,800
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Employee Editor"
FONT 8, "MS Shell Dlg"
BEGIN
/*LTEXT "ID: ",IDC_STATIC,50,50,20,20
LTEXT "Name: ",IDC_STATIC,100,50,20,20
LTEXT "Birth Date: ",IDC_STATIC,150,50,20,20
LTEXT "SSN: ",IDC_STATIC,200,50,20,20
LTEXT "Phone: ",IDC_STATIC,250,50,20,20
LTEXT "Hired: ",IDC_STATIC,300,50,20,20
LTEXT "Discharged: ",IDC_STATIC,350,50,20,20
LTEXT "Pay: ",IDC_STATIC,400,50,20,20
LTEXT "Salary: ",IDC_STATIC,450,50,20,20
LTEXT "Active: ",IDC_STATIC,500,50,20,20
LTEXT "HireNotes: ",IDC_STATIC,550,50,20,20
LTEXT "DischargeNotes: ",IDC_STATIC,600,50,20,20
LTEXT "Notes: ",IDC_STATIC,650,50,20,20*/
DEFPUSHBUTTON "OK",ID_OK,400,400,20,30
END

Boris K K
March 21st, 2006, 07:31 AM
1. It is much easier to design a dialog with a WYSIWYG resource editor :)

2. Most probably you don't have IDC_STATIC defined. Do you have a file named "winres.h" in your include directory and its subdirectories? Or try adding
#define IDC_STATIC (-1)
before the dialog definition.

3. It should be IDOK, not ID_OK. At least if you want to use the constant from winuser.h.

Brenton S.
March 21st, 2006, 07:32 AM
There doesn't seem to be anything wrong with it.

Reaem
March 22nd, 2006, 02:58 AM
You're absolutely right. I would've never imagined the compiler to tell me "syntax error" for a variable not being found. lol, guess it isnt too great when it comes to resources
TY=)
-R