CFormView在非文档视的结构中出现问题
用向导创建了一个非文档视的单文档App,我想用CFormView来代替原来默认的CView,于是我从CFormView派生出一个新类CDataFormView,由于CFormView的Create方法是protected的,所以我在CDataFormView中override基类的Create方法。代码如下:
BOOL CDataFormView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
return CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
}
现在CDataFormView的创建一点问题都没有,按我意愿出现了,但是问题出现在关闭窗体的时候,当点击主窗体的关闭按钮时,跳出一个出错来:
Debug Assertion failed
Program: H:\VC\FVTest\Debug\FVTest.exe
File: dbgheap.c
Line: 1017
Expression:_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)