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