我在一个dialog里面加了个View视图,可是Release下总是弹出错误,提示下面的信息。
Debug Assertion Failed!
File:viewsorl.cpp
Line:134
但是这个错误在debug状态下却没有,请高手指点
OnInitDialog()
{
CCreateContext pContext;
CWnd* pFrameWnd = this;
pContext.m_pCurrentDoc = new CDocument;
pContext.m_pNewViewClass = RUNTIME_CLASS(CScrollView);
CScrollView *pView =(CScrollView *) ((CFrameWnd*)pFrameWnd)->CreateView(&pContext);
ASSERT(pView);
// pView->m_nMapMode = MM_TEXT;
pView->ShowWindow(SW_NORMAL);
CRect rectWindow;
//GetWindowRect(rectWindow);
GetClientRect(&rectWindow);
rectWindow.right -= 5;
rectWindow.bottom -= 200;
pView->MoveWindow(rectWindow);
}