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 Question....

MDI Question....

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++data-structureshelpworkspace
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.
  • R Offline
    R Offline
    Ryan B
    wrote on last edited by
    #1

    My MDI App has two Document Types. One we can call a workspace. One we can call a doc. Ive registered each document type with the application using the framework. I have also added the code that only allows "1" workspace to be opened at a time. I have also destroyed the "view" of the workspace, because I want the data to be displayed in a dockable tree ctrl, which i have also created, and is a member of MainFrame. My Questions.... How do i get access to the workspace document (the current one) from my tree ctrl. If I have both a workspace open and multiple "docs", how can I place a call to GetDocument and get only the "workspace" document? excuse my silly questions, im not experienced with MFC or doc/view. Im moving along though. HELP ME KEEP MY MOMENTUM =) Ryan Baillargeon

    G 1 Reply Last reply
    0
    • R Ryan B

      My MDI App has two Document Types. One we can call a workspace. One we can call a doc. Ive registered each document type with the application using the framework. I have also added the code that only allows "1" workspace to be opened at a time. I have also destroyed the "view" of the workspace, because I want the data to be displayed in a dockable tree ctrl, which i have also created, and is a member of MainFrame. My Questions.... How do i get access to the workspace document (the current one) from my tree ctrl. If I have both a workspace open and multiple "docs", how can I place a call to GetDocument and get only the "workspace" document? excuse my silly questions, im not experienced with MFC or doc/view. Im moving along though. HELP ME KEEP MY MOMENTUM =) Ryan Baillargeon

      G Offline
      G Offline
      Gary Kirkham
      wrote on last edited by
      #2

      If there is only one workspace doc then you could do this POSITION pos = ((CYourApp*)AfxGetApp())->m_pDocTemplate->GetFirstDocPosition(); CYourDoc *pDoc = (CYourDoc*) ((CYourApp*)AfxGetApp())->m_pDocTemplate->GetNextDoc(pos); where m_pDocTemplate is your workspace template...make it public or add a public function to get a pointer to it Gary Kirkham A working Program is one that has only unobserved bugs

      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