Instead of
CWnd* pWnd = GetParent()->GetParent()->Ge
pPopup->TrackPopupMenu(TPM_
this);
try to use
CWnd* pWnd = GetParentFrame();
pPopup->TrackPopupMenu(TPM_
pWnd);
See GetParentFrame details at
http://msdn.microsoft.com/
Main Topics
Browse All Topics





by: DanRollinsPosted on 2009-04-25 at 18:08:39ID: 24234128
Have you seen this article: en-us/libr ary/essk9a b2.aspx
When Update Handlers Are Called
http://msdn.microsoft.com/
I can't tell from your code, but... there has to be an ON_UPDATE_COMMAND_UI entry and (this is the most common oversight) there must also be an ON_COMMAND entry somewhere with the same command ID
Also, command UI is usually in the MainFrame, so that's what you will typically used as the owning window in the TrackPopupMenu call