CDocument & CDialog
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
Hi forum, how can I get datas from a CDocument-Class to a dialog? Is this possible? The function GetDocument() doesn't work, because CDialog is derived from CObject and not from CView! Can somebody help me? Thanks
1. In MyDlg.h add #include "MyDoc.h" 2. Add a member variable to you dialog class CMyDoc* m_pDoc; 3. In the function that creates the dialog - after the dialog is create but before DoModal() - add dlg.m_pDoc = (CMyDoc*)GetDocument();