Home > Software engineering >  VS2013 new MFC single document item, check the document/view architecture
VS2013 new MFC single document item, check the document/view architecture

Time:09-25

VS2013 MFC single document new project, do not check the document/view architecture,

Only CMainFrame and CChildView class and CXXXApp class the three main classes, but CChildView, inherited from the CWnd class now amended as CMainView inherited from CListView,



In the OnInitialUpdate this function, not be invoked, actually can VC6.0, not the new version, if must contain document class, or a better way,

CodePudding user response:

CodePudding user response:

CCreateContext
Cc content too little! Such as m_pCurrentFrame?

CodePudding user response:

Such as

BOOL CMyCwndWnd: : OnCreateClient (LPCREATESTRUCT LPCS, CCreateContext * pContext)
{
CCreateContext CC.
CC. M_pCurrentFrame=this;
CC. M_pCurrentDoc=NULL;
CC. M_pNewViewClass=RUNTIME_CLASS (CMyCwndListView);
PCwndListView=(CMyCwndListView *) CreateView (& amp; CC, AFX_IDW_PANE_FIRST);
return TRUE;
}

CodePudding user response:

reference schlafenhamster reply: 3/f
if

BOOL CMyCwndWnd: : OnCreateClient (LPCREATESTRUCT LPCS, CCreateContext * pContext)
{
CCreateContext CC.
CC. M_pCurrentFrame=this;
CC. M_pCurrentDoc=NULL;
CC. M_pNewViewClass=RUNTIME_CLASS (CMyCwndListView);
PCwndListView=(CMyCwndListView *) CreateView (& amp; CC, AFX_IDW_PANE_FIRST);
return TRUE;
}








VS2013 or not, the List List view is created, but just don't call don't response OnInitialUpdate, List not insert column???

CodePudding user response:

CC. M_pLastView=NULL;
//
M_pwndView=(CMainView *) CreateView (& amp; CC, AFX_IDW_PANE_FIRST);
//
Note AFX_IDW_PANE_FIRST is displayed

CodePudding user response:

You can build a standard document SDI, OnInitialUpdate breakpoint, test and operation, take a look at the hierarchy

CodePudding user response:

reference 5 floor schlafenhamster reply:
 CC. M_pLastView=NULL; 
//
M_pwndView=(CMainView *) CreateView (& amp; CC, AFX_IDW_PANE_FIRST);
//

Note AFX_IDW_PANE_FIRST will show


Solved this problem is solved the building Lord, give points ah, do not give points for a message to OK ah, someone has solved the problem for you at least give a feedback

CodePudding user response:

You can build a standard document SDI, OnInitialUpdate breakpoint, test and operation, look at the hierarchy, the, so as to find the problem source
  • Related