WinMainCRTStartup -> CWinApp::CWinApp -> CMyApp::CMyApp @
-> WinMain -> ::AfxWinMain -> ::AfxGetApp @
-> ::AfxWinInit -> ::AfxInitThread @
-> CWinApp::InitApplication @
-> CWinApp::InitInstance -> CSingleDocTemplate::CSingleDocTemplate @
-> CWinApp::AddDocTemplate @
-> CWinApp::ParseCommandLine @
-> CWinApp::ProcessShellCommand -> CWinApp::OnFileNew -> CDocTemplate::OpenDocumentFile ①
-> CWinApp::Run ⑦
-> CWinApp::ExitInstance @
-> ::AfxWinTerm @
-> CWinApp::~CWinApp -> CMyApp::~CMyApp @
① CSingleDocTemplate::OpenDocumentFile -> CDocTemplate::CreateNewDocument -> CDocument::CDocument @
-> CDocTemplate::CreateNewFrame -> CFrameWnd::CFrameWnd -> CMainFrame::CMainFrame @
-> CWnd::Create ②
-> CDocument::OnNewDocument ⑥
-> CFrameWnd::InitialUpdateFrame @
② CFrameWnd::Create -> CFrameWnd::PreCreateWindow -> CMainFrame::PreCreateWindow @

③ : WM_CREATE
③ CMainFrame::OnCreate -> CFrameWnd::OnCreateClient -> CFrameWnd::CreateView -> CView::CView -> CMyView::CMyView @
-> CWnd::Create ④
④ CView::Create -> CView::PreCreateWindow -> CMyView::PreCreateWindow @

⑤ : WM_CREATE
⑤ CMyView::OnCreate @
⑥ CMyDoc::OnNewDocument @
⑦ CWinApp::Run -> CWinThread::Run -> CWinThread::PumpMessage ↘
⑧ : 루프
-> CWinThread::OnIdle ↗
⑧ CWnd::WindowProc -> CCmdTarget::OnCmdMsg @

WM_SYSCOMMAND => CWnd::OnSysCommand -> ⑨ : WM_CLOSE
⑨ CFrameWnd::OnClose -> CWndDestroyWindow -> ⑩ : WM_DESTROY -> ⑫ : 객체 소멸
↘ ⑪ : WM_NCDESTROY ↗
⑩ CWnd::OnDestroy @
⑪ CWnd::OnNcDestroy @
⑫ CView::~CView -> CFrameWnd::~CFrameWnd -> CDocument::~CDocument -> CSingleDocTemplate::~CSingleDocTemplate @


::AfxWinMain -> ::AfxGetApp @
-> ::AfxWinInit -> ::AfxInitThread @
-> CWinApp::InitApplication @
-> CWinApp::InitInstance -> CSingleDocTemplate::CSingleDocTemplate @
-> CWinApp::AddDocTemplate @
-> CWinApp::ParseCommandLine @
-> CWinApp::ProcessShellCommand -> CWinApp::OnFileNew -> CDocTemplate::OpenDocumentFile ①을 수행
-> CWinApp::Run 을 수행
-> CWinApp::ExitInstance @
-> ::AfxWinTerm @
-> CWinApp::~CWinApp -> CMFCAppApp::~CmfcAppApp @


출처: http://microdev.pe.kr/22

Posted by 모과이IT
,