Solved

Manually Cascading through CEditView MDI Childs

Posted on 1998-05-05
2
197 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 70 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Strange date stored 22 100
Window placement 17 65
scoreUp challenge 14 48
Problem to open Excel file 15 44
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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 discusses moving either the default database or any database to a new volume.

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now