Home > Software engineering >  GetDocument (); Illegal calling non-static into function
GetDocument (); Illegal calling non-static into function

Time:11-19

MFC single document, a view inside the function to obtain the document object pointer, GetDocument (); Non-static into the function of illegal call

CodePudding user response:

GetDocument generally in the View class, want to use it will have to add in the dialog
the statement and the implementation function

CodePudding user response:

CMainFrame * pMain=(CMainFrame *) AfxGetMainWnd ();
The CView * pView=pMain - & gt; GetActiveView ();
CDocment pDoc=pView - & gt; GetDocument ();

CodePudding user response:

GetDocument is the CView class member functions, you must first get the CView class pointer
  • Related