子窗口关闭问题
我建了个多文档窗口,VIEW类以FORMVIEW为基类,我用SendMessage(WM_COMMAND,ID_FILE_NEW)建立子窗口,当我想改变子窗口数量时,我怎样去销毁子窗口,现用SendMessage新建?我用POSITION ps;
CESCYMasterApp* m_app = (CESCYMasterApp*)AfxGetApp();
ps = m_app->m_pDocTemplate->GetFirstDocPosition();
if(ps != NULL)
{
for(int j=0;j<m_npreSlaveCnt;j++)
{
m_pDocument = (CESCYMasterDoc*)m_app->m_pDocTemplate->GetNextDoc(ps);
CESCYMasterView *pView;
POSITION psView;
psView = m_pDocument->GetFirstViewPosition();
pView = (CESCYMasterView*)(m_pDocument->GetNextView(psView));
::PostMessage((pView->GetParentFrame()->m_hWnd),WM_ES_CLOSECHILDFRMAE,0, 0);
}
}
销毁时,老是报内存错误,请大家帮忙想想办法,谢谢