?
Solved

Iterate through all open child frames

Posted on 2007-03-30
2
Medium Priority
?
516 Views
Last Modified: 2013-11-20
Hi,

I have a wizard generated MDI application. How can I iterate through all open child frames? I know how to do this in the general case, but my child frames are all using splitter windows. This always returns NULL in this case:

        POSITION posView = pDoc->GetFirstViewPosition();

for my other 'normal' child frame types, it works fine.

Thanks
0
Comment
Question by:DJ_AM_Juicebox
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Expert Comment

by:paix120
ID: 18826491
Hello, I use a loop like this in my VB.NET code:

Dim ChildForm As Form
For Each ChildForm In Me.MdiChildren
    [code here like ChildForm.GetType.Tostring or whatever info you need for the child]
Next
0
 
LVL 9

Accepted Solution

by:
Priyesh earned 2000 total points
ID: 18826805
Try this.
void CMainFrame::OnCountFrames()
{
      POSITION posTemplate = theApp.m_pDocManager->GetFirstDocTemplatePosition() ;
      while(posTemplate != NULL)
      {
            CDocTemplate* pDocTemp = theApp.m_pDocManager->GetNextDocTemplate(posTemplate) ;

            POSITION posDoc = pDocTemp->GetFirstDocPosition() ;
            while(posDoc != NULL)
            {
                  CDocument* pDoc = pDocTemp->GetNextDoc(posDoc) ;
                  POSITION posView = pDoc->GetFirstViewPosition() ;
                  if(posView != NULL)
                  {
                        CView* pView = pDoc->GetNextView(posView) ;            
                        CString szName ;
                        pView->GetParentFrame()->GetWindowText(szName) ;
                        AfxMessageBox(szName) ;
                  }
            }
      }
}
HTH
Priyesh
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month11 days, 7 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question