Cannot change Menu entries state
Posted on 1998-05-19
I did my sceletton application with the MFC AppWizzard. I have a SDI application with several views (splitter windows) and a menu for the mainframe window. Now the problem is: i cannot change the state of pop up menu entries, i've tried:
CWnd* pMainFrame = AfxGetMainWnd();
CMenu* pMainFrameMenu = pMainFrame->GetMenu();
ASSERT(pMainFrameMenu != NULL);
I get the right menu pointer, with:
(I tried pMainFrameMenu->GetMenuString(IDM_COMMPORTSETTINGS_DISCONNECT, ...) i get the menu entry
i want to change, but the state of this menu point does not change, and i do not know why.
The weird thing is also the following: When i edit the menu in the resource editor and set the checkmark for this
menu entry to "grayed" then it appears also grayed in the resource editor. But if i compile my program and run
it then the same menu entry is enabled and not grayed !!!!!
Does anybody knows help? i would appreciate it very much, cause i have no idea where the problem could be