Thread: Resource file parse error

  1. #1
    Tha 1 Sick RAT
    Join Date
    Dec 2003
    Posts
    271

    Resource file parse error

    Hi I'm stupmed as to what the parse error is in this resource file which I grabbed form a tutorial as I'm learning windows programming.
    Code:
    IDR_MYMENU MENU
    BEGIN
        POPUP "&File"
        BEGIN
            MENUITEM "E&xit", ID_FILE_EXIT
        END
    
        POPUP "&Stuff"
        BEGIN
            MENUITEM "&Go", ID_STUFF_GO
            MENUITEM "G&o somewhere else", 0, GRAYED
        END
        
        POPUP "&Help"
        BEGIN
            MENUITEM "&About", ID_HELP_ABOUT
            MENUITEM "&Version", 0, GRAYED
        END
    END
    
    IDD_ABOUT DIALOG DISCARDABLE 0, 0, 239, 70
    STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU  <---- apparently there's a parse error here :confused: 
    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 Lanre",
                        IDC_STATIC,16,18,144,33
    END
    Anyone know what it is??
    A hundred Elephants can knock down the walls of a fortress... One diseased rat can kill everyone inside

  2. #2
    Registered User Xzyx987X's Avatar
    Join Date
    Sep 2003
    Posts
    107
    I loaded it up in Visual C++ and it worked for me. What compiler are you using?

  3. #3
    Tha 1 Sick RAT
    Join Date
    Dec 2003
    Posts
    271
    The latest incarnation (I hope) of dev c++
    A hundred Elephants can knock down the walls of a fortress... One diseased rat can kill everyone inside

  4. #4
    Registered User Xzyx987X's Avatar
    Join Date
    Sep 2003
    Posts
    107
    That could be the problem then. If your tutorial was meant to be used with VC++ they might not have checked for any compatibility issues with other compilers. One thing though, did you try sticking #include <windows.h> at the top of the file?

  5. #5
    Tha 1 Sick RAT
    Join Date
    Dec 2003
    Posts
    271
    Yeap. i think It maybe an issue with Dev C++ because when I close and re-open the program it runs, albeit without resources allocated so I gets me an empty window, but when i go into project options and click on win 32 console it gives me the error. But this only happens sometimes.
    A hundred Elephants can knock down the walls of a fortress... One diseased rat can kill everyone inside

  6. #6
    Tha 1 Sick RAT
    Join Date
    Dec 2003
    Posts
    271
    Anybody please help. This is driving me off my bloody rocks!!
    A hundred Elephants can knock down the walls of a fortress... One diseased rat can kill everyone inside

  7. #7
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Did you include the header file in your resource script for your ID definitions?

    Also include <windows.h> in the resource script for those dialog style definitions.

    Also define a value for IDC_STATIC (-1), because Dev-C++ doesn't do it automatically.

    After I did all that, your resource script compiled in Dev-C++.
    Last edited by Dante Shamest; 03-09-2004 at 02:05 PM.

  8. #8
    Tha 1 Sick RAT
    Join Date
    Dec 2003
    Posts
    271
    Thnx for the help Dante. I'm now geting a linker error which I never had before in my other windows programming tests.
    Code:
    [Linker error] undefined reference to `mcount'
    Anyone know what's causing this error?
    A hundred Elephants can knock down the walls of a fortress... One diseased rat can kill everyone inside

  9. #9
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Probably a function or a variable that you're trying to use, but wasn't defined.

    Post or zip up and attach your code, so we can take a better look at it.

  10. #10
    Tha 1 Sick RAT
    Join Date
    Dec 2003
    Posts
    271
    Ok thx.
    A hundred Elephants can knock down the walls of a fortress... One diseased rat can kill everyone inside

  11. #11
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    I need resource.h too.

  12. #12
    Tha 1 Sick RAT
    Join Date
    Dec 2003
    Posts
    271
    only a few lines in it but:

    #define IDR_MYMENU 101
    #define ID_HELP_ABOUT 105
    #define IDD_ABOUT 106
    #define IDI_MYICON 201

    #define ID_FILE_EXIT 9001
    #define ID_STUFF_GO 9002
    #define IDC_STATIC -1

    There they are
    A hundred Elephants can knock down the walls of a fortress... One diseased rat can kill everyone inside

  13. #13
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Everything compiled okay.

    I've attached my Dev-C++ project.

  14. #14
    Tha 1 Sick RAT
    Join Date
    Dec 2003
    Posts
    271
    Thanx again for the help. I sent you a PM.
    A hundred Elephants can knock down the walls of a fortress... One diseased rat can kill everyone inside

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  2. Using VC Toolkit 2003
    By Noobwaker in forum Windows Programming
    Replies: 8
    Last Post: 03-13-2006, 07:33 AM
  3. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  4. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 05:44 PM
  5. Linking error
    By DockyD in forum C++ Programming
    Replies: 10
    Last Post: 01-20-2003, 05:27 AM