新闻资讯
看你所看,想你所想

RemoveDocument

RemoveDocument

介绍

类: CDocTemplate
头档案:
afxwin.h
功能:
删除由pDoc指向的文档,它来自于与这个模板相关的文档列表。
语法:
void RemoveDocument(CDocument*pDoc);
参数:
pDoc 要被移除的文档的指针
说明:
派生类CMultiDocTemplate 与CSingleDocTemplate

示例

/**************************************************************************
演示函式原型:CDocTemplate::RemoveDocument(CDocument*pDoc);
程式功能说明:删除指定文档。
*************************************************************************/
//每个文档模板对象拥有 m_pOnlyDoc 或 m_docList (文档指针或文档指针列表),以//CMultiDocTemplate
//为例,MultiDocTemplate类定义了实现多文档界面(MDI)的文档模板。。
// 派生类CMultiDocTemplate的RemoveDocument(CDocument* pDoc)函式,内部调用了//CDocTemplate::RemoveDocument(pDoc);
void CMultiDocTemplate::RemoveDocument(CDocument* pDoc)
{  
ASSERT_VALID(pDoc);    
CDocTemplate::RemoveDocument(pDoc); //删除指定文档
m_docList.RemoveAt(m_docList.Find(pDoc)); //删除文档在伫列中的记录
}

转载请注明出处海之美文 » RemoveDocument

相关推荐

声明:此文信息来源于网络,登载此文只为提供信息参考,并不用于任何商业目的。如有侵权,请及时联系我们:ailianmeng11@163.com