zoukankan      html  css  js  c++  java
  • MFC 框架各部分指针获取方式

     

    获得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() 
     
  • 相关阅读:
    Scratch-Blockly配置过程
    Scratch www 系统搭建
    Scratch3.0——项目层次结构
    用canvas播放scratch文件
    Scratch3.0——克隆代码仓库的正确姿势
    Scratch3.0——作品截图
    Scratch GUI
    Ubuntu下Visual Studio Code的配置
    关于Ubuntu16.04下phpmyadmin出现mbstring错误的正解
    ubuntu搭建LAMP全教程及简单使用
  • 原文地址:https://www.cnblogs.com/youxin/p/2856612.html
Copyright © 2011-2022 走看看