What I need is when I select MenuItem1, MenuItem1 is grayed and MenuItem2, which is originally grayed, is enabled.
And my code is as follows.
CMenu* pMenu = GetMenu();
pMenu->EnableMenuItem( ID_MenuItem1, MFS_GRAYED );
pMenu->EnableMenuItem( ID_MenuItem2, MFS_ENABLED);
SetMenu( pMenu );
But nothing changes!!! Please help!
P.S. I know how to make it work through ON_UPDATE_COMMAND_UI(). I'm just wondering why EnableMenuItem() doesn't work.