我在菜单中使用如下程序调用一个FormView:if(m_Hoist!=NULL)
{
m_Hoist->MDIActivate();
return;
} m_Hoist=new CChildFrame();
CCreateContext context;
context.m_pNewViewClass=RUNTIME_CLASS(CHoistOperation);
if(!m_Hoist->LoadFrame(IDR_MAINFRAME,WS_MAXIMIZE|WS_OVERLAPPEDWINDOW,this,&context))
return;
m_Hoist->ShowWindow(SW_SHOWMAXIMIZED);
m_Hoist->InitialUpdateFrame(NULL,true);在我的FormView的OnInitialUpdate中有如下程序:
CFormView::OnInitialUpdate();
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCrane_CMSDoc)));(执行这条语句时报错)
CCrane_CMSDoc *pDoc = (CCrane_CMSDoc*)m_pDocument;
//CFormView * aa=pDoc->GetNextView ;
pDoc->SetTitle("Form1");
在程序编译时,没有任何错误和警告.谢谢大家帮忙看看!
{
m_Hoist->MDIActivate();
return;
} m_Hoist=new CChildFrame();
CCreateContext context;
context.m_pNewViewClass=RUNTIME_CLASS(CHoistOperation);
if(!m_Hoist->LoadFrame(IDR_MAINFRAME,WS_MAXIMIZE|WS_OVERLAPPEDWINDOW,this,&context))
return;
m_Hoist->ShowWindow(SW_SHOWMAXIMIZED);
m_Hoist->InitialUpdateFrame(NULL,true);在我的FormView的OnInitialUpdate中有如下程序:
CFormView::OnInitialUpdate();
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCrane_CMSDoc)));(执行这条语句时报错)
CCrane_CMSDoc *pDoc = (CCrane_CMSDoc*)m_pDocument;
//CFormView * aa=pDoc->GetNextView ;
pDoc->SetTitle("Form1");
在程序编译时,没有任何错误和警告.谢谢大家帮忙看看!
context.m_pCurrentDoc
context.m_pCurrentFrame
context.m_pLastView
context.m_pNewDocTemplate
context.m_pNewViewClass
m_pDocument不是一上CCrane_CMSDoc的实例的指针?
如果是,那么m_pDocument应该已经被破坏了
参考
http://topic.csdn.net/t/20041105/20/3526364.html