Solved

Manually Cascading through CEditView MDI Childs

Posted on 1998-05-05
2
207 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
[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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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
Replacement selected text 2 69
maven archtype selection in eclipse 1 59
Excel file not created as expected 7 110
ERP and the other system process verification 5 26
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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

739 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