How can I check/uncheck a Pop-up menu item that belongs to a CommandBar menu?I tried the following piece of code, but without results (except the crash I get :( ):
[...somewhere in InitDialog()...]
CCeCommandBar *m_hWndCB = (CCeCommandBar*)m_pWndEmptyCB; // pointer to commandbar
m_hWndCB->InsertMenuBar(IDR_BEAMERMENU_MAIN); // insert menubar in commandbar. IDR_BEAMERMENU_MAIN is a menubar that has three pop-up menus, with subitems on each menu
CMenu *menuBeamerPrefs = m_hWndCB->GetMenuBar(1); // pointer to menubar submenu #2
menuBeamerPrefs->CheckMenuItem(IDM_BEAMER_MAIN_PREFS_RECV, MF_CHECKED); // fails and the application crashes
Any help is much appreciated!