Article ID: 145857
Article Last Modified on 11/21/2006
// .h file
// HMENU m_hMyMenu;
// virtual HMENU GetDefaultMenu(); // get menu depending on state
HMENU CMyDocument::GetDefaultMenu()
{
return m_hMyMenu; // just use original default
}
Remember to initialize this member variable to NULL either in the
constructor or CDocument::OnNewDocument().
// example within CView member function
((CMyDocument*)GetDocument())->m_hMyMenu = ::LoadMenu(
AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_MYMENU1));
((CFrameWnd*)AfxGetMainWnd())->OnUpdateFrameMenu(NULL);
AfxGetMainWnd()->DrawMenuBar();118435 Sharing Menus Between MDI Child Windows.
Additional query words: kbinf 1.00 1.50 1.51 1.52 1.10 2.00 2.10 2.20 2.5 2.50 2.51 2.52 2.52b 3.0 3.00 3.1 3.10 3.2 3.20 4.0 4.00
Keywords: kbcode KB145857