Dev-Cpp: Resource Script Syntax

This is a discussion on Dev-Cpp: Resource Script Syntax within the Windows Programming forums, part of the Platform Specific Boards category; What is the proper syntax for this? Code: IDD_ABOUT DIALOG DISCARDABLE 0, 0, 239, 66 STYLE DS_MODALFRAME | WS_POPUP | ...

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    21

    Thumbs down Dev-Cpp: Resource Script Syntax

    What is the proper syntax for this?
    Code:
    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
    Got it of of here

    It keeps giving me a syntax error.

  2. #2
    Registered User
    Join Date
    Mar 2005
    Location
    Juneda
    Posts
    287
    Did you predefined the IDC_STATIC identifyers? Try to change them by some int, that should work. Then define them before use. And include also the windows.h in the rc file.
    Niara

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    21
    defining IDC_STATIC does save some futures problems. Right now though, I still keep getting syntax error on this line (its highlighted when I try to compile it):

    Code:
    STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU

    Here is my full resource code:
    Code:
    #include "main.h"
    MAINMENU MENU
    {
        POPUP "&File"
        {
            MENUITEM "E&xit", ID_FILE_EXIT
        }
    
        POPUP "&Stuff"
        {
            MENUITEM "&About", ID_ABOUT
            MENUITEM "G&o somewhere else", 0, GRAYED
        }
    }
    
    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
    Here is my main.h code:
    Code:
    #define ID_FILE_EXIT 9001
    #define ID_ABOUT 9002
    
    #define IDOK 9003
    #define IDCANCEL 9004
    #define IDC_STATIC 9009

  4. #4
    return 0;
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    89
    You should also include windows.h in your resource files

  5. #5
    Registered User
    Join Date
    Sep 2005
    Posts
    21
    doh! I should have listened the first time to the suggestion of including windows.h

    I thought you were refering to something like main.h

    Thanks, it works perfectly now!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 09:26 AM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  3. Using VC Toolkit 2003
    By Noobwaker in forum Windows Programming
    Replies: 8
    Last Post: 03-13-2006, 07:33 AM
  4. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 10:33 AM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21