Originally Posted by
koushal.vv
Hope this works....
CMainFrame* pFrame ; // Memeber variable
pFrame = (CMainFrame*) AfxGetMainWnd();
pFrame->GetMenu()
->EnableMenuItem(ID_SORT_MANAGER,MF_GRAYED);
But make sure that u have set the m_bAutoMenuEnable = false;
The code that you provided here is not working. CMainFrame and pFrame is giving me errors and syntax errors too. Here is what I got right now and I still dont understand why is this not working
CWnd* pParent = GetParent();
CMenu* pMenu = pParent->GetMenu();
CMenu* submenu = pMenu->GetSubMenu(0);
submenu->EnableMenuItem(0, MF_BYPOSITION | MF_GRAYED );
Please help me out
Last edited by vickzbrit; Nov 23rd, 2008 at 4:06 pm.