MFC 주요 클래스 호출 순서
http://blog.naver.com/mirzzz79/110013137412
MFC Single Document FrameWork
- MFC 주요 클래스의 호출 순서는 다음과 같이 이루어지며,
클래스 공유되어 사용되는 리소스 클래스를 포인터로 연결하여 사용할때
소멸 순서에 의하 잘못된 포인터 참조를 막기위해, 리소스는 Document에
생성하여 링크하는 것이 가장 효율적이며, 관리하기 좋다.
## Construct CApp ##
CApp::CApp()
CApp::InitInstance()
## Construct CDoc ##
CDoc::CDoc()
## Construct CMainFrame ##
CMainFrame::CMainFrame()
CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
CMainFrame::Create(LPCTSTR lpszClassName, ...)
CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
CMainFrame::OnWndMsg(UINT message, ...)
CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
## Construct CView ##
CView::CView()
CView::Create(LPCTSTR lpszClassName, ...)
CView::PreCreateWindow(CREATESTRUCT& cs)
CView::OnCreate(LPCREATESTRUCT lpCreateStruct)
## Document Restore ##
CDoc::OnNewDocument() -> 내부 Pre Call - CDoc::DeleteContents()
## View Setting ##
CView::OnInitialUpdate()
CMainFrame::OnWndMsg(UINT message, ...)
CMainFrame::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
CView::OnDraw(CDC* /*pDC*/)
## Thread Setting ##
CApp::Run()
## Loop ##
whlie(true)
{
CApp::OnIdle(LONG lCount)
CApp::PreTranslateMessage(MSG* pMsg)
CMainFrame::OnWndMsg(UINT message, ...)
CMainFrame::PreTranslateMessage(MSG* pMsg)
CMainFrame::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
CView::OnDraw(CDC* /*pDC*/)
}
CMainFrame::OnClose()
## Document Release ##
CDoc::OnCloseDocument() -> 내부 Post Call - CDoc::DeleteContents()
CMainFrame::DestroyWindow()
CMainFrame::OnDestroy()
## Destroy CView ##
CView::OnDestroy()
CView::~CView()
## Destroy CMainFrame ##
CMainFrame::~CMainFrame()
## Destroy CDoc ##
CDoc::~CDoc()
CApp::ExitInstance()
## Destroy CApp ##
by. mirz (2007.1)
[출처] MFC 주요 클래스 호출 순서|작성자 모냐