In the SDI and MDI of the MFC, you have to get CXXXView from your cxxxapp (of course to inherit CWINAPP), you are not a very easy thing, or it is very roundabout. Here's how to get, ok, let us start. If we have to get a view pointer, we must get a pointer to the document, how to get a document class, first we have to get the document template pointer (ie, cdoCtemplate), how to get the document template, very simple, is through CWINAPP Class can be obtained. The specific process is as follows: 1) Location 2 of the document template 2) Depending on the position of the template 3) Location 4 of the document 4) Pointer 5) According to the position of the document 5), according to the document, the location 6) Depending on the location of the view, you get the pointer of the view, which is what we have to get. Everyone see, is it very painful? See the figure below: OK, give the specific implementation code // get the position of the first document template position pos = getFirstDoCtemplatePosition (); // do we have a valid template Position? If (pos) {// Get a Pointer to the document template CDocTemplate * pDocTemp = GetNextDocTemplate (pos);? // Do we have a valid pointer if (pDocTemp) {// Get the position of the first document pOSITION dPos = pDocTemp-> GetFirstDocPosition (); // Do we HAVE A VALID DOCUMENT POSITION? IF (DPOS) {/ Get a Pointer to the Document CtaskingDoc * PdocWnd = (CTASKINGDOC *) PDOCTEMP-> GetNextDoc (DPOS); // Do WE HAVE A VALID POINTER? IF (PDocWnd) {/ / Get the position of the view position vpos = pdocwnd-> getFirstViewPosition (); // do we have a valid view position? If (vpos) {// Get a pointer to the view ctaskingview * pView = (ctaskingview *) PDOCWND- > GetNextView (VPOS);}}}