我想在单文档程序中运行后不显示视图窗口,在点击菜单栏上的按钮后才显示出来,怎样实现?

解决方案 »

  1.   

    在主框架实现文件中的OnCreate()消息中处理
    int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
    {
    if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
    return -1;
    // create a view to occupy the client area of the frame
    if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
    CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
    {
    TRACE0("Failed to create view window\n");
    return -1;
    }
             m_wndView.ShowWindow(false);  //添加这句试试
    }