I am trying to disable main menu items. in MDI application, this works:
CWnd *pW=AfxGetMainWnd();
CMenu * pMenu=pW->GetMenu();
pMenu->EnableMenuItem(5, MF_BYPOSITION | MF_GRAYED | MF_DISABLED);
Not in SDI. Most likely, I am putting it into the wrong place. CMainframe? The view? Which speific subroutine? I tried the constructors, but no change in UI.
Any help is appreciated, I am banging my head and searched numerous web places (and here) but didn't find the right direction.
many thanks
you can do that by using class wizard to add function that handles Enabling/disabling menu items via UPDATE_COMMAND_UI:
in my code I enabled the menu item
AddNew
.