Accessing View and Doc From Application object 
Author Message
 Accessing View and Doc From Application object

Hi Everybody...

What are the alternatives for accessing member functions(and data) of the
View and the Document objects from the Application object?

Is there any mechanism  similar to CView::GetDocument ?

Thanks in advance

Izack Lesher



Thu, 30 May 2002 03:00:00 GMT  
 Accessing View and Doc From Application object
Izack,

Some ideas.

If your application has only one type of document and view class you can do
this.

CMyDoc *pDoc = (CMyDoc*)AfxGetMainWnd()->GetActiveDocument();
CMyView *pView = (CMyView*)AfxGetMainWnd()->GetActiveView();

I was next going to go into using the CDocTemplate methods to find documents
and view; however, I see Scott already has.

Dave Smith
MCSE, MCT, MVP


Quote:
> Hi Everybody...

> What are the alternatives for accessing member functions(and data) of the
> View and the Document objects from the Application object?

> Is there any mechanism  similar to CView::GetDocument ?

> Thanks in advance

> Izack Lesher



Thu, 30 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Accessing View & Doc from Application object

2. How to Access View methods from Document in MFC DOC/VIEW

3. Getting 2nd Doc/View data from 1st Doc/View

4. Seeing doc-declared object from View-class?

5. Obtaining active view and active doc from theApp object

6. ShellEmbedding, Doc Object View and Internet Explorer Server

7. Seeing doc-declared object from View-class?

8. UserControl and Doc-View application

9. Help with accessing doc/view from app

10. MDI Application w/o doc/view-concept

11. Help: MDI non-doc/view application

12. COM interface to SDI Doc-View application

 

 
Powered by phpBB® Forum Software