Solved

Iterate through all open child frames

Posted on 2007-03-30
2
510 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 500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do you programatically show and hide the Windows 10 On-Screen-Keyboard? 3 1,003
countEvens challenge 2 116
Is there a simple front-end menu system. 9 144
Work with App store 7 119
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

737 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