Click to See Complete Forum and Search --> : MDI without menus


ric980
October 22nd, 1999, 05:15 AM
I am trying to make a full screen MDI but I am getting troubles when trying to get rid of the menus. A debug failure occurs when ::CreateEx is trying to execute. This happens in the InitInstance when trying to load the Main frame. I will be grateful if someone shows me the trick? I do not want to register new wndclass and I do not want to hide the menus.

Mike Harnad
October 22nd, 1999, 07:21 AM
If you're trying to remove the main menu, try this...

//
// Destroys normal menu associated with
// mainframe application.
//
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{

if ( cs.hMenu != NULL )
{
::DestroyMenu( cs.hMenu ); // Delete menu if loaded
cs.hMenu = NULL; // No menu for main window
}

return CFrameWnd::PreCreateWindow(cs);
}