Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Popup Menu not popping up ;(

This topic is 6616 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, all. This is straight from the book. It compiles fine, but when I run it and click the RMB, no popup menu appears. What gives? CMenu * g_pmenuContext; CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { ... g_pmenuContext = new CMenu(); if (!g_pmenuContext) return -1; BOOL bSuccess = g_pmenuContext->LoadMenu(IDR_MENU1); if (!bSuccess) return -1; ... } void CMainFrame::OnRButtonDown(UINT nFlags, CPoint point) { ClientToScreen(&point); CMenu * psubmenu = g_pmenuContext->GetSubMenu(1); psubmenu->TrackPopupMenu(TPM_LEFTALIGN /TPM_RIGHTBUTTON, point.x, point.y, this); CFrameWnd::OnRButtonDown(nFlags, point); } Thanks

Share this post

Link to post
Share on other sites

You need to handle the WM_CONTEXTMENU message.

void CMyView::OnContextMenu(CWnd* pWnd, CPoint point)
CMenu menu;


Edited by - Sparkle on 4/12/00 5:24:44 AM

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!