What is a parse error and how are they caused?

This is a discussion on What is a parse error and how are they caused? within the Windows Programming forums, part of the Platform Specific Boards category; I was working on a project, and was adding a dialog to it and when I tried, all that happened ...

  1. #1
    Registered User Finchie_88's Avatar
    Join Date
    Aug 2004
    Posts
    154

    Question What is a parse error and how are they caused?

    I was working on a project, and was adding a dialog to it and when I tried, all that happened was that there was a parse error in the resource file that I included in my program.
    Code:
    IDD_OPTIONS DIALOG DISCARDABLE 0,0,239,66
    STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
    CAPTION "Options"
    FONT 8, "MS Sans Serif"
    BEGIN
        DEFPUSHBUTTON   "&OK",IDOK,174,18,50,14
        PUSHBUTTON      "&Cancel",IDCANCEL,174,35,50,14
        CTEXT           "The is a test to get it wo work",
                        IDC_STATIC,16,18,144,33
    END

  2. #2
    Even death may die... Dante Shamest's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    Posts
    970
    A parse error means that your code is not structurally correct (i.e. syntax error).

    Try changing it to

    Code:
    #include <windows.h>
    #define IDC_STATIC -1
    IDD_OPTIONS DIALOG DISCARDABLE 0,0,239,66
    STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
    CAPTION "Options"
    FONT 8, "MS Sans Serif"
    BEGIN
        DEFPUSHBUTTON   "&OK",IDOK,174,18,50,14
        PUSHBUTTON      "&Cancel",IDCANCEL,174,35,50,14
        CTEXT           "The is a test to get it wo work",
                        IDC_STATIC,16,18,144,33
    END

Popular pages Recent additions subscribe to a feed

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