• <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 葉子 閱讀(2432) 評論(1)  編輯 收藏 引用 所屬分類: C\C++

            Feedback

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

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

            国产亚洲美女精品久久久久狼| 亚洲色欲久久久综合网东京热| 国产精品成人99久久久久91gav| 国产ww久久久久久久久久| 欧美大战日韩91综合一区婷婷久久青草| 色综合久久天天综线观看| 久久精品国产亚洲AV香蕉| 欧美午夜A∨大片久久 | 欧洲成人午夜精品无码区久久| 国产精品免费福利久久| 国产精品久久久久a影院| 久久99精品国产麻豆宅宅| 亚洲精品视频久久久| 99久久无色码中文字幕| 久久久久久国产精品无码下载 | 久久久久久久综合狠狠综合| 婷婷久久香蕉五月综合加勒比| 久久婷婷人人澡人人| 久久精品国产99国产电影网| 久久精品国产2020| 国产欧美久久久精品影院| 亚洲午夜久久久精品影院| 2021少妇久久久久久久久久| 99久久国产综合精品女同图片 | 久久青青草原亚洲av无码| 欧美综合天天夜夜久久| 91久久精一区二区三区大全| 中文字幕无码免费久久| 久久精品人妻中文系列| 狠狠色丁香久久婷婷综合蜜芽五月| 99久久婷婷国产综合精品草原| 久久se精品一区精品二区| 97久久精品国产精品青草| 国内精品人妻无码久久久影院 | 久久精品国产亚洲av影院 | 国产精品久久久久9999| 久久ww精品w免费人成| av无码久久久久不卡免费网站 | 99久久国产宗和精品1上映| 欧美日韩精品久久久久| 亚洲国产精品无码久久久不卡 |