
Dynamically change a menu label
I am trying to change a menu item label text dynamically in reponse to a
menu
command. Here is the code that does not work, what could be my problem?
void CMainFrame::OnUpdateTrayHide(CCmdUI* pCmdUI)
{
CString HideShow;
if (m_AppInTray == false)
{
HideShow = _T("Hide");
}
else if(m_AppInTray == true)
{
HideShow = _T("Show");
}
pCmdUI->SetText(HideShow);
MessageBox(HideShow); // this updates correctly so I know the string is
changing
Quote:
}