|
-
April 26th, 1999, 07:03 AM
#1
MFC View
Hi,
In a MFC Doc/View application, when I want to access a member function of the Doc class from a view class, I write :
CMyProgramDoc* pDoc = GetDocument();
After that, I can pass pDoc to another class and I can access member functions of CMyProgramDoc class.
I want to do the same thing with CMyProgramView.
How can I do that ?
Thanks
Claude
-
April 26th, 1999, 07:35 AM
#2
Re: MFC View
I do this by creating a pointermember of the Viewclass in the documentclass :
CMyView *m_pView;
In the OnInitialUpdate of the viewclass I set this variable as follows :
CMyDoc *pDoc = (CMyDoc *) GetDocument();
pDoc->m_pView = this;
When you want to access multiple views you can use the GetNextView(), GetFirstViewPosition() methods of CDocument.
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
|