MDI程序是怎么运行的,
比如初始化啊,什么时候掉ondraw函数啊,
和SDI的程序有什么区别?

解决方案 »

  1.   

    Application starts               CMyDocument object constructed
                                     CMyView object constructed
                                     Other view objects constructed
                                     View windows created
                                     CMyView::OnCreate called (if mapped)
                                     CDocument::OnNewDocument called
                                     CView::OnInitialUpdate called
                                        Calls CMyView::OnUpdate
                                       Initializes the view
    User executes                 CMyView functions update CMyDocument
    view command                  data members
                                           Call CDocument::UpdateAllViews
                                             Other views' OnUpdate functionscalled
    User executes               MyDocument functions update data
    document command            members
                                           Call CDocument::UpdateAllViews
                                            CMyView::OnUpdate called
                                           Other views' OnUpdate functions called
    User exits application        View objects destroyed
                                                  CMyDocument object destroyed
      

  2.   

    上面的.个是MDI的... 下面这个是SDI的...
    Application starts        CMyDocument object constructed 
                              CMyView object constructed 
                              View window created 
                              CMyView::OnCreate called (if mapped) 
                              CMyDocument::OnNewDocument called 
                              CMyView::OnInitialUpdate called                                    View object initialized
                                        View window invalidated
                                        CMyView::OnDraw called 
     
    User edits data              CMyView functions update CMyDocument data members User exits application           CMyView object destroyed 
                                  CMyDocument object destroyed