I have a pointer to a CMenu object that I created and the menu is being displayed as a context menu. I want to disable (gray) one of the menu items and I can't get it to "gray out". I know my pointer is valid because I can get use CheckMenuItem(...) perfectly fine. Has anyone come across this problem? Any other way to get it working? Here's my code...
m_pPopMenu->EnableMenuItem(IDM_PROPERTIES, MF_GRAYED); //Not working!
m_pPopMenu->CheckMenuItem(IDM_OTHERITEM, MF_CHECKED); //This works fine!
CMenu* pContextMenu = m_pPopMenu->GetSubMenu(0);
pContextMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this);
Does it matter that I created the CMenu object's resource at compile time instead of at runtime? (I'm using MFC and MSVC++ .NET).
Thanks in advance.
m_pPopMenu->EnableMenuItem(IDM_PROPERTIES, MF_GRAYED); //Not working!
m_pPopMenu->CheckMenuItem(IDM_OTHERITEM, MF_CHECKED); //This works fine!
CMenu* pContextMenu = m_pPopMenu->GetSubMenu(0);
pContextMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this);
Does it matter that I created the CMenu object's resource at compile time instead of at runtime? (I'm using MFC and MSVC++ .NET).
Thanks in advance.