Menu

IDC_STATIC not defined????

2003-01-29
2012-09-26
  • Kenneth George

    Kenneth George - 2003-01-29

    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?

     
    • Nobody/Anonymous

      This has been talked a while ago, try searching the forum on that;

       
    • Patrick Ogay

      Patrick Ogay - 2003-01-29

      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

       
    • Nobody/Anonymous

      #define IDC_STATIC -1

      You should #include <windows.h>. L8tr

      Kip

       
    • Nobody/Anonymous

      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.

       
    • Kenneth George

      Kenneth George - 2003-01-30

      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.

       
    • Roger Hedin

      Roger Hedin - 2003-01-30

      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

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.