Article ID: 141532
Article Last Modified on 11/21/2006
/* Compile options needed: default
*/
// Use this code to fix the problem:
void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex,
BOOL bSysMenu)
{
#if _MFC_VER == 0x400
AfxLockTempMaps();
#endif
CMDIFrameWnd::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
// TODO: Add your message handler code here
#if _MFC_VER == 0x400
AfxUnlockTempMaps();
#endif
}
// Use the following code to reproduce the problem in an MDI application:
void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex,
BOOL bSysMenu)
{
CMDIFrameWnd::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
// The next line will cause an ASSERT on line 1034 in a debug
// build because pPopupMenu is an invalid pointer
pPopupMenu->CheckMenuItem(0, MF_BYPOSITION | MF_CHECKED);
}
139469 How to Use TrackPopupMenu() and Update UI Handlers
Additional query words: kbVC400bug 4.00 4.10
Keywords: kbbug kbfix kbnoupdate kbuidesign kbvc410fix KB141532