zoukankan      html  css  js  c++  java
  • MFC中的指针

    下表总结了MFC中获取各个类指针的方法,很全面,很简洁,很有参考价值。

    From this class:

    You can access this class using:

    CWinApp

    CMainFrame

    CChildFrame

    CDocument

    CView

    CWinApp

     

    AfxGetMainWnd() or

    m_pMainWnd

    AfxGetMainWnd()->

    MDIGetActive()

    AfxGetMainWnd()->

    GetActiveView()->

    GetDocument()

    AfxGetMainWnd()->

    GetActiveView()

    CMainFrame

    AfxGetApp() or

    theApp

     

    MDIGetActive() or

    GetActiveFrame()

    SDI: GetActiveView()->

    GetDocument()

    MDI: MDIGetActive()->

    GetActiveView()->

    GetDocument()

    SDI: GetActiveView()

    MDI: MDIGetActive()->

    GetActiveView()

    CChildFrame

    AfxGetApp() or

    theApp

    GetParentFrame()

     

    GetActiveView()->

    GetDocument()

    GetActiveView()

    CDocument

    AfxGetApp() or

    theApp

    AfxGetMainWnd()

    AfxGetMainWnd()->

    MDIGetActive()

     

    POSITION pos =

    GetFirstViewPosition();
    GetNextView(pos);

    (see note below)

    CView

    AfxGetApp() or

    theApp

    AfxGetMainWnd()

    GetParentFrame()

    GetDocument()

     

    any other class

    AfxGetApp()

    AfxGetMainWnd()

    AfxGetMainWnd()->

    MDIGetActive() or

    AfxGetMainWnd()->

    GetActiveFrame()

    SDI:AfxGetMainWnd()->

    GetActiveView()->

    GetDocument()

    MDI:AfxGetMainWnd()->

    MDIGetActive()->

    GetActiveView()->

    GetDocument()

    SDI:AfxGetMainWnd()->

    GetActiveView()

    MDI:AfxGetMainWnd()->

    MDIGetActive()->

    GetActiveView()

    Note: To access only the current view, the document class can call AfxGetMainWnd()->GetActiveView() from a SDI application or AfxGetMainWnd()->MDIGetActive()->GetActiveView() from a MDI application.


  • 相关阅读:
    Confluence 6 在升级过程中查看合并日志
    Confluence 6 从 WIKI 标记整合到基于 XHTML 的存储格式
    Confluence 6 升级完成后的检查
    Confluence 6 超过当前许可证期限进行升级
    HDU2571--命运---DP
    HDU 2084 DP经典例子---数塔问题
    紫书第二章
    求组合数
    欧拉函数
    二分幂/快速幂
  • 原文地址:https://www.cnblogs.com/loongfee/p/2252128.html
Copyright © 2011-2022 走看看