Sign in to follow this  
yckx

windres/RC MENUITEM syntax error

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this