MFC启动大致顺序

大致顺序是这样的
CDlgTestDlg::CDlgTestDlg
CDlgTestDlg::DoModal
    CDialog::DoModal
CDlgTestDlg::PreSubclassWindow
CDlgTestDlg::OnCreate
CDlgTestDlg::OnSize
CDialog::OnInitDialog
    CWndUpdateData(FALSE)
        CDlgTestDlg::DoDataExchange
              CDlgTestDlg::OnInitDialog
CDlgTestDlg::OnShowWindow
CDlgTestDlg::OnPaint
CDlgTestDlg::OnCtlColor
CDlgTestDlg::PreTranslateMessage
CDlgTestDlg::OnPaint
用户输入数据...
用户单击OK
CDlgTestDlg::OnOK
    CDialog::OnOK
        CWnd::UpdateData(TRUE)
            CDlgTestDlg::DoDataExchange
CDlgTestDlg::OnCtlColor
CDlgTestDlg::OnDestroy
CDlgTestDlg::PostNcDestroy

你可以在OnCreate里产生控件试试,到了OnInitDialog就应该初始化了
原文出处 http://topic.csdn.net/t/20030609/10/1892803.html

你可能感兴趣的:(mfc)