Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Manually Cascading through CEditView MDI Childs

Posted on 1998-05-05
2
Medium Priority
?
213 Views
Last Modified: 2013-11-20
I am implementing a find and replace feature in a project (MDI) and I decided to give the option of searching through all open views.  How can I gain access to each view sequentially?
0
Comment
Question by:bradk
2 Comments
 
LVL 4

Accepted Solution

by:
piano_boxer earned 280 total points
ID: 1307697
This code will walk through all open views in a app:
------------

POSITION pos = AfxGetApp()->GetFirstDocTemplatePosition();
while(pos)
{
    CDocTemplate* pTemplate = AfxGetApp()->GetNextDocTemplate(pos);
    POSITION docpos = pTemplate->GetFirstDocPosition();
    while(docpos)
    {
        CDocument* pDoc = pTemplate->GetNextDoc(docpos);
        POSITION viewpos = pDoc->GetFirstViewPosition();
        while(viewpos)
        {
            CView* pView = pDoc->GetNextView(viewpos);

            //
            // Do your stuff
            //
        }
    }
}

0
 

Author Comment

by:bradk
ID: 1307698
Thanks
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

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. …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

971 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