• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            elva

            VC MFC SDI/MDI框架各部分指針獲取方式


                

            獲得CWinApp

            獲得CMainFrame

            獲得CChildFrame

            獲得CDocument

            獲得CView

            在CWinApp中

            AfxGetMainWnd()

            m_pMainWnd

            AfxGetMainWnd()->MDIGetActive()

            AfxGetMainWnd()->GetActiveFrame()

            SDI:AfxGetMainWnd()->GetActiveView()->GetDocument()

            MDI:AfxGetMainWnd()->MDIGetActive()->GetActiveView()->GetDocument()

            SDI:AfxGetMainWnd()->GetActiveView()  
            MDI:AfxGetMainWnd()->MDIGetActive()->GetActiveView()
            在CMainFrame中

            AfxGetApp()

            theApp

            MDIGetActive()

            GetActiveFrame()

            SDI:GetActiveView()->GetDocument()  
            MDI:MDIGetActive()->GetActiveView()->GetDocument()  
            SDI:GetActiveView()  
            MDI:MDIGetActive()->GetActiveView()
            在CChildFrame中

            AfxGetApp()

            theApp

            GetParentFrame()

            GetActiveView()->GetDocument()  GetActiveView()
            在CDocument中

            AfxGetApp()

            theApp

            AfxGetMainWnd()  

            AfxGetMainWnd()->MDIGetActive()

            AfxGetMainWnd()->GetActiveFrame()

            POSITION   pos   =   GetFirstViewPosition();GetNextView(pos)  
            在CView中

            AfxGetApp()

            theApp

            AfxGetMainWnd()  GetParentFrame()  GetDocument()
            在其他類中

            AfxGetApp()

            AfxGetMainWnd()  

            AfxGetMainWnd()->MDIGetActive()

            AfxGetMainWnd()->GetActiveFrame()

            SDI:AfxGetMainWnd()->GetActiveView()->GetDocument()

            MDI:AfxGetMainWnd()->MDIGetActive()->GetActiveView()->GetDocument()

            SDI:AfxGetMainWnd()->GetActiveView()  
            MDI:AfxGetMainWnd()->MDIGetActive()->GetActiveView()
            理一理MFC的這幾個類的關系,可以很容易明白上面的這些亂七八糟的邏輯。
            App是應用域,所有的域中的東西都可以通過全局函數訪問到它。
            MainFrame是主框架,也基本可以用全局函數訪問到。
            MainFrame下是若干個ChildFrame,ChildFrame中若干個View和Document(可能不成對),ChildFrame管理著View,View和Document進行互操作。
            因此整體框架就出來了,一般除了直接應用的關系都可以通過MainFrame-->Active ChildFrame-->Active View-->Document這條線進行訪問,這應該叫什么來自?萬能方法吧^_^。

            posted on 2009-04-07 10:51 葉子 閱讀(2430) 評論(1)  編輯 收藏 引用 所屬分類: C\C++

            Feedback

            # re: VC MFC SDI/MDI框架各部分指針獲取方式 2009-06-29 10:06 亂78糟

            總結的可以,頂一下  回復  更多評論   

            四虎影视久久久免费观看| 狠狠色丁香久久综合婷婷| 久久精品国产亚洲AV久| 久久综合噜噜激激的五月天| 国产亚洲综合久久系列| 办公室久久精品| 日韩人妻无码一区二区三区久久99| 久久精品国产免费观看三人同眠| 色综合久久久久综合体桃花网| 亚洲一区中文字幕久久| 久久99热这里只有精品国产| 国产午夜免费高清久久影院| 精品久久久久久无码国产| 亚洲精品白浆高清久久久久久 | 伊人久久亚洲综合影院| 99久久国产热无码精品免费久久久久| 久久久久一级精品亚洲国产成人综合AV区| 久久99精品国产自在现线小黄鸭| 久久精品无码av| 久久精品亚洲男人的天堂| 久久精品国产清高在天天线| 国产亚洲精品久久久久秋霞| 伊人久久大香线蕉无码麻豆| 亚洲乱亚洲乱淫久久| 久久天堂AV综合合色蜜桃网| 久久无码AV一区二区三区| 中文字幕一区二区三区久久网站| 亚洲精品午夜国产VA久久成人| 久久婷婷五月综合色99啪ak| 国产成人精品久久亚洲| 久久久久四虎国产精品| 99热精品久久只有精品| 午夜不卡888久久| 久久99精品综合国产首页| 精品国产VA久久久久久久冰| 日韩精品久久无码中文字幕| 午夜精品久久久久久毛片| 无码AV波多野结衣久久| 无码国产69精品久久久久网站| 日韩AV无码久久一区二区 | 久久中文字幕视频、最近更新|