Resource syntax error...

This is a discussion on Resource syntax error... within the Windows Programming forums, part of the Platform Specific Boards category; Code: Code: //Microsoft Developer Studio generated resource script. // #include "resource.h" #include "windows.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from ...

  1. #1
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318

    Resource syntax error...

    Code:
    Code:
    //Microsoft Developer Studio generated resource script.
    //
    #include "resource.h"
    #include "windows.h"
    
    #define APSTUDIO_READONLY_SYMBOLS
    /////////////////////////////////////////////////////////////////////////////
    //
    // Generated from the TEXTINCLUDE 2 resource.
    //
    /////////////////////////////////////////////////////////////////////////////
    #undef APSTUDIO_READONLY_SYMBOLS
    
    /////////////////////////////////////////////////////////////////////////////
    // English (U.S.) resources
    
    #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
    #ifdef _WIN32
    LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
    #pragma code_page(1252)
    #endif //_WIN32
    
    #ifdef APSTUDIO_INVOKED
    /////////////////////////////////////////////////////////////////////////////
    //
    // TEXTINCLUDE
    //
    
    1 TEXTINCLUDE DISCARDABLE 
    BEGIN
        "resource.h\0"
    END
    
    2 TEXTINCLUDE DISCARDABLE 
    BEGIN
        "#include ""afxres.h""\r\n"
        "\0"
    END
    
    3 TEXTINCLUDE DISCARDABLE 
    BEGIN
        "\r\n"
        "\0"
    END
    
    #endif    // APSTUDIO_INVOKED
    
    
    /////////////////////////////////////////////////////////////////////////////
    //
    // Accelerator
    //
    
    IDR_TCWINDOW ACCELERATORS DISCARDABLE 
    BEGIN
        "x",            IDM_CLOSE,              ASCII,  ALT, NOINVERT
    END
    
    
    /////////////////////////////////////////////////////////////////////////////
    //
    // Cursor
    //
    
    IDC_CURBEYE             CURSOR  DISCARDABLE     "C:\\Programs\\memory\\BULLSEYE.CUR"
    
    /////////////////////////////////////////////////////////////////////////////
    //
    // Dialog
    //
    
    IDD_ABOUTBOX DIALOG DISCARDABLE  22, 17, 174, 77
    STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
    CAPTION "About"
    FONT 8, "System"
    BEGIN
        ICON            IDI_ICOLARGE,IDC_MYICON,14,9,20,20
        LTEXT           "MDump Version 1.0",IDC_STATIC,49,10,86,8,SS_NOPREFIX
        LTEXT           "Copyright (C) 2003",IDC_STATIC,49,20,85,8
        DEFPUSHBUTTON   "OK",IDOK,136,4,30,11,WS_GROUP
        LTEXT           "Timothy Carpenter",IDC_STATIC,49,31,85,8
    END
    
    
    /////////////////////////////////////////////////////////////////////////////
    //
    // Icon
    //
    
    // Icon with lowest ID value placed first to ensure application icon
    // remains consistent on all systems.
    IDI_ICOLARGE            ICON    DISCARDABLE     "main.ico"
    IDI_ICOSMALL            ICON    DISCARDABLE     "small.ico"
    
    /////////////////////////////////////////////////////////////////////////////
    //
    // Menu
    //
    
    IDM_APPWINDOW MENU DISCARDABLE 
    BEGIN
        POPUP "&File"
        BEGIN
            MENUITEM "&Select Window",              ID_FILE_SELECT
            MENUITEM "E&xit",                       ID_FILE_EXIT
        END
        POPUP "&Search"
        BEGIN
            MENUITEM "&Find",                       ID_FIND
            MENUITEM "&Unicode Find",               ID_UNICODEFIND
            MENUITEM "Find &Next F3",               ID_FINDNEXT
        END
        POPUP "&Help"
        BEGIN
            MENUITEM "&About",                      ID_HELP_ABOUT
        END
    END
    
    IDM_HEXWINDOW MENU DISCARDABLE 
    BEGIN
        POPUP "&File"
        BEGIN
            MENUITEM "E&xit",                       ID_FILE_EXIT
        END
    END
    
    
    /////////////////////////////////////////////////////////////////////////////
    //
    // DESIGNINFO
    //
    
    #ifdef APSTUDIO_INVOKED
    GUIDELINES DESIGNINFO DISCARDABLE 
    BEGIN
        IDD_ABOUTBOX, DIALOG
        BEGIN
            BOTTOMMARGIN, 75
        END
    END
    #endif    // APSTUDIO_INVOKED
    
    
    /////////////////////////////////////////////////////////////////////////////
    //
    // String Table
    //
    
    STRINGTABLE DISCARDABLE 
    BEGIN
        IDS_APP_TITLE           "TCWindow Title"
    END
    
    #endif    // English (U.S.) resources
    /////////////////////////////////////////////////////////////////////////////
    
    
    
    #ifndef APSTUDIO_INVOKED
    /////////////////////////////////////////////////////////////////////////////
    //
    // Generated from the TEXTINCLUDE 3 resource.
    //
    
    
    /////////////////////////////////////////////////////////////////////////////
    #endif    // not APSTUDIO_INVOKED
    Compile log:
    Code:
    Compiler: Default compiler
    Building Makefile: "C:\Programs\Dev-Cpp\memory2\Makefile.win"
    Executing  make...
    make.exe -f "C:\Programs\Dev-Cpp\memory2\Makefile.win" all
    windres.exe -i Project1_private.rc --input-format=rc -o Project1_private.res -O coff 
    
    windres.exe: ../../memory/BorMDUMP.rc:78: syntax error
    
    make.exe: *** [Project1_private.res] Error 1
    
    Execution terminated
    Syntax error points to this line:
    Code:
        LTEXT           "MDump Version 1.0",IDC_STATIC,49,10,86,8,SS_NOPREFIX
    I can't figure it out. Any ideas?

  2. #2
    Even death may die... Dante Shamest's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    Posts
    970
    Add this somewhere. Maybe below #include <windows.h>

    Code:
    #define IDC_STATIC -1

  3. #3
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>Any ideas?<<

    Using an ms compiler autogenerated resource script with windres, mingw's resource compiler, is not a good idea at the best of times. Try replacing the #include <windows.h> line with #include <afxres.h>; IDC_STATIC is not defined by default in mingw's headers but its dummy afxres.h does the job and makes sure windows.h is #included to enable use of the resource definition statements. It might be a good idea to prune out all the ms specific rubbish, too, to make it more readable, something like:
    Code:
    //Microsoft Developer Studio generated resource script.
    //
    #include "resource.h"
    //#include "windows.h"
    #include <afres.h>
    
    /////////////////////////////////////////////////////////////////////////////
    //
    // Accelerator
    //
    
    IDR_TCWINDOW ACCELERATORS DISCARDABLE 
    BEGIN
        "x",            IDM_CLOSE,              ASCII,  ALT, NOINVERT
    END
    
    
    /////////////////////////////////////////////////////////////////////////////
    //
    // Cursor
    //
    
    IDC_CURBEYE             CURSOR  DISCARDABLE     "C:\\Programs\\memory\\BULLSEYE.CUR"
    
    /////////////////////////////////////////////////////////////////////////////
    //
    // Dialog
    //
    
    IDD_ABOUTBOX DIALOG DISCARDABLE  22, 17, 174, 77
    STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
    CAPTION "About"
    FONT 8, "System"
    BEGIN
        ICON            IDI_ICOLARGE,IDC_MYICON,14,9,20,20
        LTEXT           "MDump Version 1.0",IDC_STATIC,49,10,86,8,SS_NOPREFIX
        LTEXT           "Copyright (C) 2003",IDC_STATIC,49,20,85,8
        DEFPUSHBUTTON   "OK",IDOK,136,4,30,11,WS_GROUP
        LTEXT           "Timothy Carpenter",IDC_STATIC,49,31,85,8
    END
    
    
    /////////////////////////////////////////////////////////////////////////////
    //
    // Icon
    //
    
    // Icon with lowest ID value placed first to ensure application icon
    // remains consistent on all systems.
    IDI_ICOLARGE            ICON    DISCARDABLE     "main.ico"
    IDI_ICOSMALL            ICON    DISCARDABLE     "small.ico"
    
    /////////////////////////////////////////////////////////////////////////////
    //
    // Menu
    //
    
    IDM_APPWINDOW MENU DISCARDABLE 
    BEGIN
        POPUP "&File"
        BEGIN
            MENUITEM "&Select Window",              ID_FILE_SELECT
            MENUITEM "E&xit",                       ID_FILE_EXIT
        END
        POPUP "&Search"
        BEGIN
            MENUITEM "&Find",                       ID_FIND
            MENUITEM "&Unicode Find",               ID_UNICODEFIND
            MENUITEM "Find &Next F3",               ID_FINDNEXT
        END
        POPUP "&Help"
        BEGIN
            MENUITEM "&About",                      ID_HELP_ABOUT
        END
    END
    
    IDM_HEXWINDOW MENU DISCARDABLE 
    BEGIN
        POPUP "&File"
        BEGIN
            MENUITEM "E&xit",                       ID_FILE_EXIT
        END
    END
    
    /////////////////////////////////////////////////////////////////////////////
    //
    // String Table
    //
    
    STRINGTABLE DISCARDABLE 
    BEGIN
        IDS_APP_TITLE           "TCWindow Title"
    END
    edit: beaten by Dante.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  4. #4
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Now I have almost the same problem, with this piece:
    Code:
    IDR_MENU MENU DISCARDABLE 
    BEGIN
        POPUP "File"
        BEGIN
            MENUITEM "&Close",                      IDCANCEL
            MENUITEM "",                            ID_FILE, MENUBARBREAK
            MENUITEM "About",                       ID_APP_ABOUT
        END
    END
    The error shows to the about menuitem.

  5. #5
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    What files are you #including in your resource script(*.rc)? Specifically, how and where have you #defined ID_FILE and ID_APP_ABOUT?
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. PlaySound
    By cangel in forum C++ Programming
    Replies: 16
    Last Post: 10-08-2009, 05:29 PM
  2. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 02:07 AM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 01:53 AM
  4. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 10:52 PM
  5. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 04:44 PM

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