新建的单文档工程里删掉CMainFrame里的OnCreate函数也没影响,运行后界面没什么变化,请问这个函数存不存在对界面有什么影响?

解决方案 »

  1.   

    另外,按上面的做了以后,再加上OnCreateClient虚函数,该函数起什么作用?
    BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
    {
    // TODO: Add your specialized code here and/or call the base class

    return CFrameWnd::OnCreateClient(lpcs, pContext);
    }
      

  2.   

    OnCreate函数只是对WM_CREATE消息的处理封装
    若你不想写你自己处理的代码,就不用改啦~
      

  3.   

    OnCreateClient函数是用来创建CView对象的,在OnCreate函数里被调用。比如你创建多个窗口(切分试图窗口)就可以在这个里面做。