Since I am very new to win32 programming, this just may be because I do not know enough...however, I am creating a resource file and in my code I use IDC_STATIC for representation of the value -1 in my definition of a dialog box...
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
CTEXT "An example program showing how to use Dialog Boxes\r\n\r\nby theForger",
IDC_STATIC,16,18,144,33
END
When I compile, I get a parse error at the line containing GROUPBOX. If I define IDC_STATIC at the top of the resource file, or replace IDC_STATIC with -1, everything works out fine. I am including <windows.h> in the beginning of the file, and double-checked that winuser.h contained the #define IDC_STATIC (-1) entry, which it does. Anyone have any ideas?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Check the include order.
It's not rare, that in an other include is a define the prevents the next define to do someting.
Or it need's a spezial compiler option -Dbbbb to activate some partes of an include.
be glad that it compiles :-)
Patrick
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
just a thought, you say winuser.h has IDC_STATIC defined, but it's not being seen by your program?
try #define WIN32_IE 0x600 before including windows.h, see if that fixes it. Some of the stuff in those headers is inside #if statements that check which version of the dll's you're compiling for.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for all the suggestions. The only thing that appears to work is simply defining IDC_STATIC in my resource file explicitly. Maybe this is a limitation of the mingw compiler.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well the winuser.h header defines IDC_STATIC between these ifs:
---
#if 0
/* This is supposed to be defined by the program using it not defined
in the win32api headers. I've left it here for documentation purposes.
*/
#ifndef IDC_STATIC /* May be predefined by resource compiler. */
#define IDC_STATIC (-1)
#endif
#endif
---
Guess it is never includet if you write #if 0
/Roger
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Since I am very new to win32 programming, this just may be because I do not know enough...however, I am creating a resource file and in my code I use IDC_STATIC for representation of the value -1 in my definition of a dialog box...
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
CTEXT "An example program showing how to use Dialog Boxes\r\n\r\nby theForger",
IDC_STATIC,16,18,144,33
END
When I compile, I get a parse error at the line containing GROUPBOX. If I define IDC_STATIC at the top of the resource file, or replace IDC_STATIC with -1, everything works out fine. I am including <windows.h> in the beginning of the file, and double-checked that winuser.h contained the #define IDC_STATIC (-1) entry, which it does. Anyone have any ideas?
This has been talked a while ago, try searching the forum on that;
Check the include order.
It's not rare, that in an other include is a define the prevents the next define to do someting.
Or it need's a spezial compiler option -Dbbbb to activate some partes of an include.
be glad that it compiles :-)
Patrick
#define IDC_STATIC -1
You should #include <windows.h>. L8tr
Kip
just a thought, you say winuser.h has IDC_STATIC defined, but it's not being seen by your program?
try #define WIN32_IE 0x600 before including windows.h, see if that fixes it. Some of the stuff in those headers is inside #if statements that check which version of the dll's you're compiling for.
Thanks for all the suggestions. The only thing that appears to work is simply defining IDC_STATIC in my resource file explicitly. Maybe this is a limitation of the mingw compiler.
Well the winuser.h header defines IDC_STATIC between these ifs:
---
#if 0
/* This is supposed to be defined by the program using it not defined
in the win32api headers. I've left it here for documentation purposes.
*/
#ifndef IDC_STATIC /* May be predefined by resource compiler. */
#define IDC_STATIC (-1)
#endif
#endif
---
Guess it is never includet if you write #if 0
/Roger