请教高手,怎样去除多文档框架的菜单??
我修改了下面的函数,可是给出断言:BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{

// TODO: Modify the Window class or styles here by modifying
//  the CREATESTRUCT cs  if(cs.hMenu!=NULL) 
      { 
      ::DestroyMenu(cs.hMenu); // delete menu if loaded 
      cs.hMenu = NULL; // no menu for this window 
      } 
 
    return CMDIFrameWnd::PreCreateWindow(cs);
}
是不是还要在其它什么地方修改?这个工程是用VC60+SP5,多文档类型,默认设置生成。

解决方案 »

  1.   

    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
    {
        cs.style &=WS_SYSMENU;    return CMDIFrameWnd::PreCreateWindow(cs);
    }try!
      

  2.   

    cs.style &=~WS_SYSMENU;别试了,不行
      

  3.   

    在InitInstance()中如下就可以了:
    CMultiDocTemplate* pDocTemplate;
    pDocTemplate = new CMultiDocTemplate(
    WM_USER,
    RUNTIME_CLASS(CTest_mdiDoc),
    RUNTIME_CLASS(CChildFrame), // custom MDI child frame
    RUNTIME_CLASS(CTest_mdiView));
    AddDocTemplate(pDocTemplate);