RE: How to display a PrintPreview window not the called view?
- From: v-garych@xxxxxxxxxxxxxxxxxxxx ("Gary Chang[MSFT]")
- Date: Fri, 21 Oct 2005 09:45:49 GMT
Hi Rider,
>How to display a PrintPreview window not the called view?
For example, when the CView1's window is active, you select the Print
Preview in the menu, then the CView2's Print Preview dialog will be
displayed:
To achieve this, you can definite a globle CView pointer, reference it to
the CView2's object in CView2's constructor:
//in yourApp.cpp
CView* g_pSecondView;
//in View2.cpp
extern CView* g_pSecondView;
CView2::CView2()
{
g_pSecondView = this;
}
Then in CView1::OnFilePrintPreview() function calls the
CView2::OnFilePrintPreview() instead:
//in View1.cpp
extern CView* g_pSecondView;
void CView1::OnFilePrintPreview()
{
if(g_pSecondView)
((CView2*)g_pSecondView)->OnFilePrintPreview();
else
CBaseView::OnFilePrintPreview();
}
Wish it helps!
Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Prev by Date: Re: Posting a message from a worker thread
- Next by Date: Re: Message queue in MDI app.
- Previous by thread: Posting a message from a worker thread
- Next by thread: Re: Message queue in MDI app.
- Index(es):