I am looking for a good example of how to do a pop-up menu in MFC. I have found this bit of code:
void CMyView::OnRButtonDown(UINT nFlags, CPoint point)
{
CView::OnRButtonDown(nFlags, point);
CMenu* menu_bar = AfxGetMainWnd()->GetMenu();
CMenu* file_menu = menu_bar->GetSubMenu(0);
ASSERT(file_menu);
file_menu->TrackPopupMenu(TPM_LEFTALIGN |TPM_RIGHTBUTTON, point.x,
point.y, this);
}
But what if my menu is from a seperate menu resource? And how would I go about getting a method from when the user clicks on a menu selection in the pop-up window?