I've been working for a while with Dev-C++ in Console Mode, but now I need to do a project that I have to do it as a Windows application. In this weekend, I got some tutorials, studied them, but couldn't get not even one dialog working: always getting a "Syntax error" message. Today I downloaded the ResEd recommended by the forum, designed the dialog the way I wanted, generated the resource file(listed below) and got the same error in the line:
"STYLE WS_VISIBLE|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME". I tried to delete this line but the error is moved to the line following the BEGIN. What is wrong with this resouce file? My Dev-C++ version is 4.9.9.2.
include "resource.h"
DLG_CAPTURE DIALOGEX 6,6,354,140
CAPTION "MyDialog"
FONT 8,"MS Sans Serif",400,0,0
STYLE WS_VISIBLE|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME
BEGIN
CONTROL "",TXT_SUJEITO,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP,220,88,132,13,WS_EX_CLIENTEDGE
CONTROL "",TXT_FONEMA,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP,220,105,30,13,WS_EX_CLIENTEDGE
CONTROL "Save",CMD_GRAVAR,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_NOTIFY,260,105,92,13
CONTROL "Subject:",IDC_STATIC,"Static",WS_CHILD|WS_VISIBLE|SS_NOPREFIX,190,90,24,9
CONTROL "Type:",IDC_STC1,"Static",WS_CHILD|WS_VISIBLE|SS_NOPREFIX,190,107,28,9
CONTROL "Group1",IDC_GRP1,"Button",WS_CHILD|WS_VISIBLE|BS_GROUPBOX,4,1,348,67
CONTROL "",SHP_TIME_DOMAIN,"Static",WS_CHILD|WS_VISIBLE|SS_BLACKRECT,8,14,341,49,WS_EX_CLIENTEDGE
CONTROL "",SHP_FREQ_DOMAIN,"Static",WS_CHILD|WS_VISIBLE|SS_BLACKRECT,6,84,170,49,WS_EX_CLIENTEDGE
CONTROL "Group2",IDC_GRP2,"Button",WS_CHILD|WS_VISIBLE|BS_GROUPBOX,4,72,182,67
END
Any help will be much apreciated!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I already got both tutorial and source code... the little I've acomplished so far is by information I got from it. The only problem with the tutorial is its focus on resource files generated by VC++ or BC++. Of course, it give us the idea, but in my opinion it's not so clear about how writing the resource all by hand.
I've dowloaded some GUI generators like Fox and RADC++ Studio. But with both, I designed the dialog the way I wanted. But the code generated by this tools don't run, I always get some error wich I don't know how to fix.
Any more thougts?
Luciano Braatz
I tried including windows.h, and got the same error...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem looks like the previous line
FONT 8,"MS Sans Serif",400,0,0
Change it to
FONT 8,"MS Sans Serif"
If that doesn't work try
FONT 8, "MS Shell Dlg"
"MS Shell Dlg" is not an actual font but will be assigned to a valid font that is installed on the system. It is the safest assignment. "MS Sans Serif" is probably installed, but you don't know for sure.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The reason I wanted you to use the Forger's tutorials is because I have compiled this without any problems so I know that they work. So if you keep having trouble with this one, try to compile one of thier source codes.
I don't usually use a resource editor, I enter mine by hand. I like the control! :)
One thing that I do which should not make any difference is I use { and } instead of BEGIN and END. However, a lot of people use BEGIN and END.
I am not familar with DIALOGEX. I have always used just DIALOG.
As Jim suggests try just FONT 8, "MS Sans Serif"
See Ya
Butch
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, everybody!
I've been working for a while with Dev-C++ in Console Mode, but now I need to do a project that I have to do it as a Windows application. In this weekend, I got some tutorials, studied them, but couldn't get not even one dialog working: always getting a "Syntax error" message. Today I downloaded the ResEd recommended by the forum, designed the dialog the way I wanted, generated the resource file(listed below) and got the same error in the line:
"STYLE WS_VISIBLE|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME". I tried to delete this line but the error is moved to the line following the BEGIN. What is wrong with this resouce file? My Dev-C++ version is 4.9.9.2.
include "resource.h"
DLG_CAPTURE DIALOGEX 6,6,354,140
CAPTION "MyDialog"
FONT 8,"MS Sans Serif",400,0,0
STYLE WS_VISIBLE|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME
BEGIN
CONTROL "",TXT_SUJEITO,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP,220,88,132,13,WS_EX_CLIENTEDGE
CONTROL "",TXT_FONEMA,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP,220,105,30,13,WS_EX_CLIENTEDGE
CONTROL "Save",CMD_GRAVAR,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP|BS_NOTIFY,260,105,92,13
CONTROL "Subject:",IDC_STATIC,"Static",WS_CHILD|WS_VISIBLE|SS_NOPREFIX,190,90,24,9
CONTROL "Type:",IDC_STC1,"Static",WS_CHILD|WS_VISIBLE|SS_NOPREFIX,190,107,28,9
CONTROL "Group1",IDC_GRP1,"Button",WS_CHILD|WS_VISIBLE|BS_GROUPBOX,4,1,348,67
CONTROL "",SHP_TIME_DOMAIN,"Static",WS_CHILD|WS_VISIBLE|SS_BLACKRECT,8,14,341,49,WS_EX_CLIENTEDGE
CONTROL "",SHP_FREQ_DOMAIN,"Static",WS_CHILD|WS_VISIBLE|SS_BLACKRECT,6,84,170,49,WS_EX_CLIENTEDGE
CONTROL "Group2",IDC_GRP2,"Button",WS_CHILD|WS_VISIBLE|BS_GROUPBOX,4,72,182,67
END
Any help will be much apreciated!
Butch, I think I missed the #include <windows.h> idea you talk about in your first post.
Just including this line it worked!
Thanks you all for the help!
Luciano Braatz
Hi Everyone:
I beleive that you are missing
include <windows.h>
which should appear just above #include "resource.h".
The macros you are using (WS_CHILD, WS_VISIBLE, etc are all macros) are define in windows.h.
I highly recommend you download the tutorial and source code from:
http://www.winprog.org/tutorial/
See Ya
Butch
Thanks for the reply, Butch!
I already got both tutorial and source code... the little I've acomplished so far is by information I got from it. The only problem with the tutorial is its focus on resource files generated by VC++ or BC++. Of course, it give us the idea, but in my opinion it's not so clear about how writing the resource all by hand.
I've dowloaded some GUI generators like Fox and RADC++ Studio. But with both, I designed the dialog the way I wanted. But the code generated by this tools don't run, I always get some error wich I don't know how to fix.
Any more thougts?
Luciano Braatz
I tried including windows.h, and got the same error...
The problem looks like the previous line
FONT 8,"MS Sans Serif",400,0,0
Change it to
FONT 8,"MS Sans Serif"
If that doesn't work try
FONT 8, "MS Shell Dlg"
"MS Shell Dlg" is not an actual font but will be assigned to a valid font that is installed on the system. It is the safest assignment. "MS Sans Serif" is probably installed, but you don't know for sure.
The reason I wanted you to use the Forger's tutorials is because I have compiled this without any problems so I know that they work. So if you keep having trouble with this one, try to compile one of thier source codes.
I don't usually use a resource editor, I enter mine by hand. I like the control! :)
One thing that I do which should not make any difference is I use { and } instead of BEGIN and END. However, a lot of people use BEGIN and END.
I am not familar with DIALOGEX. I have always used just DIALOG.
As Jim suggests try just FONT 8, "MS Sans Serif"
See Ya
Butch