Jump to content
  • Advertisement
Sign in to follow this  
yckx

windres/RC MENUITEM syntax error

This topic is 4347 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This compiles:
ID_MENU_APP MENUEX
{
    POPUP "&File"
    {
        MENUITEM "&New",            ID_MENU_NEW
        MENUITEM "&Open",           ID_MENU_OPEN
        MENUITEM "&Save",           ID_MENU_SAVE
        MENUITEM "Save &As",        ID_MENU_SAVEAS
        MENUITEM "&Close",          ID_MENU_CLOSE
        MENUITEM SEPARATOR
        MENUITEM "Expor&t to PDF",  ID_MENU_EXPORT
        MENUITEM "&Print",          ID_MENU_PRINT
        MENUITEM SEPARATOR
        MENUITEM "E&xit",           ID_MENU_EXIT
    }
}


But this doesn't:
ID_MENU_APP MENUEX
{
    POPUP "&File"
    {
        MENUITEM "&New",            ID_MENU_NEW
        MENUITEM "&Open",           ID_MENU_OPEN
        MENUITEM "&Save",           ID_MENU_SAVE,    GRAYED //syntax error
        MENUITEM "Save &As",        ID_MENU_SAVEAS
        MENUITEM "&Close",          ID_MENU_CLOSE
        MENUITEM SEPARATOR
        MENUITEM "Expor&t to PDF",  ID_MENU_EXPORT
        MENUITEM "&Print",          ID_MENU_PRINT
        MENUITEM SEPARATOR
        MENUITEM "E&xit",           ID_MENU_EXIT
    }
}


despite its apparent legality. Each optional parameter causes a syntax error. Guidance on what I'm doing wrong, and how to get this working, would be appreciated ;) I'm using the latest version of windres, having just upgraded it in an attempt to fix this.

Share this post


Link to post
Share on other sites
Advertisement
MENUEX requires it's own MENUITEM format, different than the one from MENU. something like this works:


#include "stdres.h"
#include "winuser.h"

ID_MENU_APP MENUEX
{
POPUP "&File"
{
MENUITEM "&New", 0
MENUITEM "&Open", 0
MENUITEM "&Save", 0, MFT_STRING, MFS_GRAYED
MENUITEM "Save &As", 0
MENUITEM "&Close", 0
MENUITEM "", -1, MFT_SEPARATOR
MENUITEM "Expor&t to PDF", 0
MENUITEM "&Print", 0
MENUITEM "", -1, MFT_SEPARATOR
MENUITEM "E&xit", 0
}
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!