
creating pop-up menus with dialog based apps gets assert error
You did not check the Popup property in the Resource Editor. If you had the
menu resource would look like this:
Quote:
>IDR_MENU3 MENU DISCARDABLE
BEGIN
POPUP "_POPUP_"
>BEGIN
> MENUITEM "", IDR_MENU3, MENUBARBREAK
> MENUITEM "This is my pop up", ID_MENUITEM32814, HELP
>END
END
Good luck
--
Pete
Quote:
>hi,
> the following example taken from the vc++ 5.0 complies fine but when it
gets
>to
>the ASSERT it blows up with an ASSERT failure
>/* from the resource file
>IDR_MENU3 MENU DISCARDABLE
>BEGIN
> MENUITEM "", IDR_MENU3, MENUBARBREAK
> MENUITEM "This is my pop up", ID_MENUITEM32814, HELP
>END
>*/
>void MyExample::OnContextMenu(CWnd* pWnd, CPoint point)
>{
> CMenu MyMenu;
> VERIFY(MyMenu.LoadMenu( IDR_MENU3 ));
> CMenu *pPopMenu = MyMenu.GetSubMenu(0);
> ASSERT (pPopMenu != NULL);
> pPopMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTALIGN,
>0,0,AfxGetMainWnd());
>}