[MFC] MFC execution flow (initialize~ finalize)
2019. 7. 29. 23:22ㆍDevelopment/C++
MFC Dialog Initialize to Finalize
mfc execution flow!
start application -> end application
CTempApp::CTempApp() ------ Since the App class variable is declared as a global variable, the constructor is called first
CTempApp::InitInstance() ------ Called from AfxWinMain function hidden in MFC code. (Responsible for loading program setting information, parameter processing, etc.)
CTempDoc::CTempDoc (void) ------ InitInstance() first creates a Document object
CMainFrame::CMainFrame (void)
CMainFrame::LoadFrame() ------ Windows are created
CMainFrame::PreCreateWindow()
CMainFrame::PreCreateWindow()
CMainFrame::OnCreate() ------ Called when a CMainFrame object is created and a window is created and a WM_CREATE message is generated automatically
CMainFrame::OnCreateClient()
CTempView::CTempView() ------ OnCreateClient() creates a View object
CTempView::Create()
CTempView::PreCreateWindow()
CTempView::OnCreate()
CTempView::OnShowWindow() ------ Proceed so far to create a client view and display it on the screen.
CMainFrame::OnCreateClient() - Return
CMainFrame::OnCreate() - Return ------ This completes the final creation of the window
CTempDoc::OnNewDocument() ------ Create a new document
CTempView::OnInitialUpdate() ------ If you create a new document or open an existing document, call this function to display the screen clean and appropriate content
CMainFrame::OnActivateApp()
CMainFrame::OnActivate() ------ The top-level window of the application is displayed and activated on the screen
CMainFrame::OnShowWindow()
CTempView::GetDocument()
CTempApp::Run() ------ Message looping
-------------------------------------------------- ---------------------------------- So far you have initialized the executable
CMainFrame::OnClose() ------ Called by WM_CLOSE message when window is closed
CMainFrame::OnShowWindow()
CMainFrame::OnActivate()
CMainFrame::OnActivateApp()
CMainFrame::DestroyWindow() ------ Called by OnClose()
CMainFrame::OnDestroy()
CTempView::OnDestroy() ------ Mainframe WM_DESTROY message is also passed to the View object which is a child
CTempView::PostNcDestroy()
CTempView::~CTempView()
CMainFrame::OnNcDestroy()
CMainFrame::PostNcDestroy()
CMainFrame::~CMainFrame()
CMainFrame::OnNcDestroy() - Return
CTempDoc::~CTempDoc() ------ When all windows are destroyed, the Document object is also destroyed.
CMainFrame::OnClose() - Return
CTempApp::ExitInstance()
CTempApp::Run() - Return
'Development > C++' 카테고리의 다른 글
[C++] Start using GDI+ Library in c++ (0) | 2019.08.01 |
---|---|
[C/C++] Five things you should not do in DLL Main you should know before Windows hooking (0) | 2019.07.31 |
[C++] start windows mouse hook example (0) | 2019.07.30 |