From: dave_t on
Hi, i'm developing an app for WM6 Prof using VS2005 C++ and MFC.
I have a dialog with a CCommandBar, i use

m_dlgCommandBar.InsertMenuBar(IDM_MAINMENU) to insert
a menu. Then in the OnInitMenuPopup handler of my dialog i want
to check if this menu that i inserted on the CommandBar is hit
if so i rebuild the menu, if its not ie its a sub menu i just return
so i have the following bit code

if (popupMenu->m_hMenu != m_dlgCommandBar.GetMenuBar())
return;

However the function keeps returning because the m_hMenu variable
does not seem to be equal to the m_dlgCommandBar.GetMenuBar()
when i press this menu.

What's going wrong?


From: dave_t on
Just to clarify i want to rebuild the menu if the softkey ( command bar
inserted
menu is pressed) if it was one of the sub pop menus i just want the
OnInitMenuPopup
handler to return hence the check. But the popupMenu->m_hMenu never equals
m_dlgCommandBar.GetMenuBar() even though this handler is triggered the
moment
i press the softkey!

"dave_t" <---> wrote in message
news:OvF7fio5IHA.2240(a)TK2MSFTNGP02.phx.gbl...
> Hi, i'm developing an app for WM6 Prof using VS2005 C++ and MFC.
> I have a dialog with a CCommandBar, i use
>
> m_dlgCommandBar.InsertMenuBar(IDM_MAINMENU) to insert
> a menu. Then in the OnInitMenuPopup handler of my dialog i want
> to check if this menu that i inserted on the CommandBar is hit
> if so i rebuild the menu, if its not ie its a sub menu i just return
> so i have the following bit code
>
> if (popupMenu->m_hMenu != m_dlgCommandBar.GetMenuBar())
> return;
>
> However the function keeps returning because the m_hMenu variable
> does not seem to be equal to the m_dlgCommandBar.GetMenuBar()
> when i press this menu.
>
> What's going wrong?
>