pointer from CView to CDocument 
Author Message
 pointer from CView to CDocument

I know it is possible to get a pointer from the view (CView) to the
document (CDocument) object when using the doc/view architecture, but is
it possible to get a pointer vica versa.  i.e from the document
(CDocument) to the view (CView)

any replys would be greatly appreciated....




Fri, 07 Sep 2001 03:00:00 GMT  
 pointer from CView to CDocument
I know it is possible to get a pointer from the view (CView) to the
document (CDocument) object when using the doc/view architecture, but is
it possible to get a pointer vica versa.  i.e from the document
(CDocument) to the view (CView)

any replys would be greatly appreciated....




Fri, 07 Sep 2001 03:00:00 GMT  
 pointer from CView to CDocument
I know it is possible to get a pointer from the view (CView) to the
document (CDocument) object when using the doc/view architecture, but is
it possible to get a pointer vica versa.  i.e from the document
(CDocument) to the view (CView)

any replys would be greatly appreciated....




Fri, 07 Sep 2001 03:00:00 GMT  
 pointer from CView to CDocument
CDocument can be associated with more than one view. To get each of them you
should use GetFirstViewPosition()/GetNextView().

The question is why do you need to get a pointer to a view from a document?
Under view/doc architecture view and frame should pass user commands to
document. After document changes its data, it should call UpdateAllViews(),
each view should handle redrawing in the OnUpdate() method. The need to
access a view directly from a document might indicate design flaw.

Quote:

> I know it is possible to get a pointer from the view (CView) to the
> document (CDocument) object when using the doc/view architecture, but is
> it possible to get a pointer vica versa.  i.e from the document
> (CDocument) to the view (CView)

> any replys would be greatly appreciated....





Fri, 07 Sep 2001 03:00:00 GMT  
 pointer from CView to CDocument
Hi!

You  cn use the methods GetFirstViewposition and GetNextView functions:
regards:
vinod kumar k.l

Quote:

> I know it is possible to get a pointer from the view (CView) to the
> document (CDocument) object when using the doc/view architecture, but is
> it possible to get a pointer vica versa.  i.e from the document
> (CDocument) to the view (CView)

> any replys would be greatly appreciated....





Sat, 08 Sep 2001 03:00:00 GMT  
 pointer from CView to CDocument

Hello,

Its quitely possible.. See microsoft "HOWTO: Get Current CDocument or CView from Anywhere" in MSDN. Article ID: Q108587

Regards,
-Senthil Kumar

Quote:

>I know it is possible to get a pointer from the view (CView) to the
>document (CDocument) object when using the doc/view architecture, but is
>it possible to get a pointer vica versa.  i.e from the document
>(CDocument) to the view (CView)

>any replys would be greatly appreciated....



-----------------** -- Posted from CodeGuru -- **-----------------
http://www.codeguru.com/    The website for Visual C++ programmers.


Sat, 08 Sep 2001 03:00:00 GMT  
 pointer from CView to CDocument
Take a look at CDocument::GetNextView() or also CFrameWnd::GetActiveView().
Either will return you a pointer to a CView.

-Shawn (camsha)

Quote:

>I know it is possible to get a pointer from the view (CView) to the
>document (CDocument) object when using the doc/view architecture, but is
>it possible to get a pointer vica versa.  i.e from the document
>(CDocument) to the view (CView)

>any replys would be greatly appreciated....





Tue, 11 Sep 2001 03:00:00 GMT  
 pointer from CView to CDocument
one way is to use the CDocument::GetActiveView();
telisc


Quote:
> I know it is possible to get a pointer from the view (CView) to the
> document (CDocument) object when using the doc/view architecture, but is
> it possible to get a pointer vica versa.  i.e from the document
> (CDocument) to the view (CView)

> any replys would be greatly appreciated....





Thu, 20 Sep 2001 04:00:00 GMT  
 pointer from CView to CDocument
GetFirstViewPos, GetNextView


Fri, 21 Sep 2001 03:00:00 GMT  
 pointer from CView to CDocument
explore  more on Getactiveview()
Quote:

>I know it is possible to get a pointer from the view (CView) to the
>document (CDocument) object when using the doc/view architecture, but is
>it possible to get a pointer vica versa.  i.e from the document
>(CDocument) to the view (CView)

>any replys would be greatly appreciated....





Tue, 09 Oct 2001 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. How get a pointer of CDocument or CView from CMDIChildWnd

2. Cdocument and CView

3. Help with CStringList in CDocument used in CView

4. Retrieve CFrameWnd from CView or CDocument

5. question about CView and CDocument

6. VISUALC Question about linking CDocument and CView

7. CDocument and CView

8. The instance of CView and CDocument

9. Works with CDocument, not with CView - Why ?

10. Link between CView and CDocument lost in SDI application

11. My CDocument is mad at my CView

12. One CDocument object and many CView objects ?

 

 
Powered by phpBB® Forum Software