resource error

This is a discussion on resource error within the Windows Programming forums, part of the Platform Specific Boards category; in my resource file my compiler Dev C++ 5, says there is a syntax error. But i can't see any ...

  1. #1
    yes, I'm registered!!! algi's Avatar
    Join Date
    Nov 2004
    Location
    Ipswich
    Posts
    161

    resource error

    in my resource file my compiler Dev C++ 5, says there is a syntax error. But i can't see any at all.

    Code:
    MyDB DIALOG 18, 18, 142, 92
    CAPTION "Test Dialog Box"
    STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
    {
          DEFPUSHBUTTON "Red", IDD_RED, 32, 40, 30, 14
                        WS_CHILD | WS_VISIBLE | WS_TABTOP //error line
          PUSHBUTTON "Green" IDD_GREEN, 74, 40, 30, 14,
                     WS_CHILD | WS_VISIBLE | WS_TABTOP
          PUSHBUTTON "Cancel", IDC_CANCEL, 52, 65, 37,14
                     WS_CHILD | WS_VISIBLE | WS_TABTOP
    }
    Non of the lines below have an error and i copied and pasted them to that line, and it still says that there is an error.
    I started out with nothing and I still have most of it left.

  2. #2
    Yah. Morgul's Avatar
    Join Date
    Feb 2005
    Posts
    109
    You missed a comma before the 14 on the red and cancel buttons, along with in several other places.


    Here is the fix:
    Code:
    MyDB DIALOG 18, 18, 142, 92
    CAPTION "Test Dialog Box"
    STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
    {
          DEFPUSHBUTTON "Red", IDD_RED, 32, 40, 30, 14,
                        WS_CHILD | WS_VISIBLE | WS_TABTOP //error line
          PUSHBUTTON "Green", IDD_GREEN, 74, 40, 30, 14,
                     WS_CHILD | WS_VISIBLE | WS_TABTOP
          PUSHBUTTON "Cancel", IDC_CANCEL, 52, 65, 37,14,
                     WS_CHILD | WS_VISIBLE | WS_TABTOP
    }
    Sic vis pacum para bellum. If you want peace, prepare for war.

  3. #3
    yes, I'm registered!!! algi's Avatar
    Join Date
    Nov 2004
    Location
    Ipswich
    Posts
    161
    now i've fixed that error it brings up this. I'm sure there is no error though.

    Code:
    MyMenu MENU
    {
           POPUP "&Dialog"
           {
                 MENUITEM "Dialog &1", IDM_DIALOG1
                 MENUITEM "Dialog &2", IDM_DIALOG2
                 MENUITEM "E&xit", IDM_EXIT
                 }
           MENUITEM "&Help", IDM_HELP
    }
    
    MyMenu ACCELERATORS
    {
           VK_F2, IDM_DIALOG1, VIRTKEY
           VK_F3, IDM_DIALOG2, VIRTKEY
           "^x",  IDM_EXIT
           VK_F1, IDM_HELP, VIRTKEY
    }
    I started out with nothing and I still have most of it left.

  4. #4
    Work in Progress..... Jaken Veina's Avatar
    Join Date
    Mar 2005
    Location
    Missouri. Go Imos Pizza!
    Posts
    256
    #include windows.h at the top of your .rc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. file reading
    By gunghomiller in forum C++ Programming
    Replies: 9
    Last Post: 08-07-2007, 10:55 PM
  2. Crazy errors caused by class, never seen before..
    By Shamino in forum C++ Programming
    Replies: 2
    Last Post: 06-10-2007, 11:54 AM
  3. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  4. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 04:44 PM
  5. UNICODE and GET_STATE
    By Registered in forum C++ Programming
    Replies: 1
    Last Post: 07-15-2002, 03:23 PM

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