Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. MDI - Access to Doc From MainFrame

MDI - Access to Doc From MainFrame

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jerry1211a
    wrote on last edited by
    #1

    I have an application where I need to access the doc page and put data there from a function that is part of the mainframe.cpp file. I know how to access the doc page from the view...but I am not doing that in this application. Also, can someone show me a simple SDI or MDI program where I can pass messages between classes, using handles to a class...forward referencing , etc, as is done in a typ C++ program with a main(). Thanks. jerry1211a jerry1211a

    K 1 Reply Last reply
    0
    • J jerry1211a

      I have an application where I need to access the doc page and put data there from a function that is part of the mainframe.cpp file. I know how to access the doc page from the view...but I am not doing that in this application. Also, can someone show me a simple SDI or MDI program where I can pass messages between classes, using handles to a class...forward referencing , etc, as is done in a typ C++ program with a main(). Thanks. jerry1211a jerry1211a

      K Offline
      K Offline
      krithika_Ramanujam
      wrote on last edited by
      #2

      Hi jerry here is the code to access doc page from mainframe.cpp ///////////////////////////////////////////////////////////// //get main wnd handle CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd; // Get the active MDI child window. CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame(); // or CMDIChildWnd *pChild = pFrame->MDIGetActive(); // Get the active view attached to the active MDI child // window. m_pView = (CTDGView *) pChild->GetActiveView(); m_pDOC = m_pView->GetDocument(); /////////////////////////////////////////////////////////// this code can be used from any part of the application to access a document. Hope this helps thanks Krithika

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups