question: CDocument from MDIChildWnd? 
Author Message
 question: CDocument from MDIChildWnd?

How can I get to the CDocument for a given MDIChildWnd?  I think I know
how to get the MDIChildWnd for a given Cdocument, but how do I go the
other way?

Thanks.
Alan Lorence.
(remove all bugs from my address for email)



Sun, 03 Dec 2000 03:00:00 GMT  
 question: CDocument from MDIChildWnd?

Hi,

Get a pointer to the view associated with the MDIChildWnd and then use
GetDocument().
To get a pointer to the view, use GetWindow(GW_CHILD). Like this:

CView* pView = (CView*) pChildWnd->GetWindow(GW_CHILD);

(where pChildWnd is a pointer to the MDIChildWnd)

Regards,
Mats Johnsson



Quote:
> How can I get to the CDocument for a given MDIChildWnd?  I think I know
> how to get the MDIChildWnd for a given Cdocument, but how do I go the
> other way?

> Thanks.
> Alan Lorence.
> (remove all bugs from my address for email)



Mon, 04 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. question: CDocument from MDIChildWnd?

2. CFormView, CDocument and MDIChildWnd in a DLL

3. MDIChildWnd Close event question

4. Opening non CDocument data file into CDocument...

5. question about CView and CDocument

6. VISUALC Question about linking CDocument and CView

7. CDocument and CListView question

8. CDocument question: testing for file exist

9. CEditView/CDocument question

10. CDocuments and the ultimate question!

11. CDocument / CView construction question

12. CDocuments and the ultimate question!

 

 
Powered by phpBB® Forum Software