-
March 30th, 2010, 06:14 AM
#1
Get pointer of CView of a CDocument-Object
Hello,
I want to get a pointer of one CView of my CDocument-Object.
It does not matter what view.
Has every CDocument at least one CView ? (MDI-app !)
Can I presum that
GetNextView(GetFirstViewPosition()) returns a valid CView-Object ?
Ralf
-
March 30th, 2010, 06:25 AM
#2
Re: Get pointer of CView of a CDocument-Object
Have a look at MSDN: CDocument::GetNextView
BTW, why do you need "to get a pointer of one CView of ... CDocument-Object"?
Victor Nijegorodov
-
March 30th, 2010, 07:11 AM
#3
Re: Get pointer of CView of a CDocument-Object
Documents don't necessarily have views.
-
March 30th, 2010, 07:28 AM
#4
Re: Get pointer of CView of a CDocument-Object
Originally Posted by VictorN
Have a look at MSDN: CDocument::GetNextView
BTW, why do you need "to get a pointer of one CView of ... CDocument-Object"?
Hello Victor,
it is a little bit complicated to explain.
I need it do call OnDraw directly.
I think, it is not usual to do it, but it is necessary.
Ralf
-
March 30th, 2010, 07:28 AM
#5
Re: Get pointer of CView of a CDocument-Object
Originally Posted by GCDEF
Documents don't necessarily have views.
in what case there is no CView for an every CDodument in a MDI-app ?
-
March 30th, 2010, 07:33 AM
#6
Re: Get pointer of CView of a CDocument-Object
Originally Posted by Ralf Schneider
Hello Victor,
it is a little bit complicated to explain.
I need it do call OnDraw directly.
I think, it is not usual to do it, but it is necessary.
Ralf
You should (must!) not do it!
Instead you should call Invalidate (or InvalidateRect) for the view you want to draw/redraw something
Victor Nijegorodov
-
March 30th, 2010, 07:44 AM
#7
Re: Get pointer of CView of a CDocument-Object
Originally Posted by VictorN
You should (must!) not do it!
Instead you should call Invalidate (or InvalidateRect) for the view you want to draw/redraw something
I do not want to render it on the screen.
I want to create a Metafile !
I call OnDraw with the DeviceContext of the metafile.
-
March 30th, 2010, 08:04 AM
#8
Re: Get pointer of CView of a CDocument-Object
Originally Posted by Ralf Schneider
in what case there is no CView for an every CDodument in a MDI-app ?
Code:
CMyDocument myDocument;
There should be a view if it's created by the framework. I'm with Victor though. I don't see why you'd need the view from the document. That sounds like a design problem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|