Click here to Skip to main content
15,927,593 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCRichEditView print an extra page Pin
Dmitry Belikov15-Aug-01 4:15
Dmitry Belikov15-Aug-01 4:15 
GeneralChanging locale and get COleDateTime to recognize it Pin
Mike Eriksson15-Aug-01 4:11
Mike Eriksson15-Aug-01 4:11 
GeneralRe: Changing locale and get COleDateTime to recognize it Pin
Not Active15-Aug-01 5:37
mentorNot Active15-Aug-01 5:37 
GeneralRe: Changing locale and get COleDateTime to recognize it Pin
Mike Eriksson15-Aug-01 23:16
Mike Eriksson15-Aug-01 23:16 
GeneralPlz tell me Pin
Muhammad Abid15-Aug-01 3:28
Muhammad Abid15-Aug-01 3:28 
GeneralDetermining Internet connection Pin
neilbennevis15-Aug-01 2:17
neilbennevis15-Aug-01 2:17 
QuestionHow to get pointer to desired view? Pin
14-Aug-01 22:22
suss14-Aug-01 22:22 
AnswerRe: How to get pointer to desired view? Pin
15-Aug-01 10:34
suss15-Aug-01 10:34 
An Application can have one or more DocTemplates. Each of them can have one or more documents. And each Document can have one or more views. So actually if you want one particular view you will have to have three levels of loops.

Anyway here is a broad outline of how to get a view from Anywhere in the app.

[ccode]
CMyApp *pApp = AfxGetApp();
CDocTemplate* pDocTemplate;
CDocument* pDoc;
POSITION rPos1,rPos2,rPos3;
CView* pView;

rPos1 = pApp->GetFirstDocTemplatePosition();

while (rPos1)
{
pDocTemplate = GetNextDocTemplate(rPos1);
if (pDocTemplate)
{
rPos2 = pDocTemplate->GetFirstDocPosition();
while(rPos2)
{
pDoc = pDocTemplate->GetNextDoc(rPos2);
if (pDoc)
{
rPos3 = pDoc->GetFirstViewPosition();
while (rPos3)
{
pView = GetNextView(rPos3);
if (pView)
{
// check if this is the desired view and do
// your stuff
}
}
}
}
}
[/ccode]

Tell me if this helps.


GeneralRe: How to get pointer to desired view? Pin
16-Aug-01 1:25
suss16-Aug-01 1:25 
GeneralRe: How to get pointer to desired view? Pin
Steen Krogsgaard16-Aug-01 1:44
Steen Krogsgaard16-Aug-01 1:44 
GeneralRe: How to get pointer to desired view? Pin
Steen Krogsgaard17-Aug-01 0:50
Steen Krogsgaard17-Aug-01 0:50 
GeneralRe: How to get pointer to desired view? Pin
Jim A. Johnson16-Aug-01 3:20
Jim A. Johnson16-Aug-01 3:20 
GeneralRe: How to get pointer to desired view? Pin
16-Aug-01 3:50
suss16-Aug-01 3:50 
GeneralRe: How to get pointer to desired view? Pin
Steen Krogsgaard17-Aug-01 0:29
Steen Krogsgaard17-Aug-01 0:29 
GeneralText properties Pin
14-Aug-01 20:57
suss14-Aug-01 20:57 
GeneralRe: Text properties Pin
Matt.W.14-Aug-01 21:59
Matt.W.14-Aug-01 21:59 
GeneralRe: Text properties Pin
14-Aug-01 22:14
suss14-Aug-01 22:14 
General3rd party control library for MFC Pin
14-Aug-01 19:57
suss14-Aug-01 19:57 
GeneralUnicode, and UTF-8 Pin
14-Aug-01 19:32
suss14-Aug-01 19:32 
GeneralRan out of controls...... Pin
Liam O'Hagan14-Aug-01 19:13
Liam O'Hagan14-Aug-01 19:13 
GeneralRe: Ran out of controls...... Pin
Michael Dunn14-Aug-01 20:41
sitebuilderMichael Dunn14-Aug-01 20:41 
GeneralSDI Multiple File Types Pin
Amit Jain14-Aug-01 17:04
Amit Jain14-Aug-01 17:04 
GeneralRe: SDI Multiple File Types Pin
Ben Burnett15-Aug-01 11:28
Ben Burnett15-Aug-01 11:28 
GeneralRe: SDI Multiple File Types Pin
Amit Jain16-Aug-01 5:02
Amit Jain16-Aug-01 5:02 
GeneralCStatic Control Pin
Joseph LeBlanc14-Aug-01 15:58
Joseph LeBlanc14-Aug-01 15:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.