MFC 执行过程

 

//AfxWinMain()函数在WINMAIN.CPP文件中,它主要调用以下函数AfxWinInit();

pApp->InitApplication();    //

pThread->InitInstance();    //调用子类中的InitInstance()

CTestApp::InitInstance();

┣━ProcessShellCommand(cmdInfo);        //对命令行进行解释

        CTestDoc::CTestDoc();        //构造文档类对象

        CMainFrame::CMainFrame();    //构造框架窗口对象

            CFrameWnd::LoadFrame();    //WINFRM.CPP

            ┣━AfxEndDeferRegisterClass();    //WINCORE.CPP,注册窗口类

                    AfxRegisterClass();    //WINCORE.CPP

            ┣━CMainFrame::PreCreateWindow();

                    CFrameWnd::PreCreateWindow();

                        AfxEndDeferRegisterClass();

            ┣━AfxRegisterClass();

            ┗━CFrameWnd::Create();        //创建CMainFrame窗口

                    CWnd::CreateEx();

                        CMainFrame::PreCreateWindow();

                            CFrameWnd::PreCreateWindow();

                        CTestView::CTestView();    //构造CTestView对象

                        CWnd::CreateEx();        //创建CTestView窗口

                            AfxEndDeferRegisterClass();

                        AfxEndDeferRegisterClass();

                        CWnd::CreateEx();        //创建CToolBar工具栏

                        AfxEndDeferRegisterClass();

                        CWnd::CreateEx();        //创建CStatusBar状态栏

                        AfxEndDeferRegisterClass();

                            AfxRegisterClass();

                        CWnd::CreateEx();        //创建CDockBar

                        AfxEndDeferRegisterClass();

                        CWnd::CreateEx();        //创建CDockBar

                        AfxEndDeferRegisterClass();

                        CWnd::CreateEx();        //创建CDockBar

                        AfxEndDeferRegisterClass();

                        CWnd::CreateEx();        //创建CDockBar

┣━m_pMainWnd->ShowWindow(SW_SHOW);    //显示窗口

┗━m_pMainWnd->UpdateWindow();        //更新窗口

nReturnCode = pThread->Run();    //进入消息循环

你可能感兴趣的:(框架,文档,mfc,工具)