这几天一直在研究多文档操作问题,现在又遇到了一个新问题!文档关闭文档问题: 下面的程序怎么实现不了关闭文档!高手帮助一下,项目要提交啦!在线等待。。。。。 for ( int i = 0 ; !pDocItr->done(); pDocItr->step(), i++ ) {
npDoc = pDocItr->document(); CString filename=npDoc->docTitle(); if(filename.TrimRight()!="Drawing1.dwg")//当前文档不关闭 {
acDocManager->setCurDocument(npDoc); acDocManager->activateDocument(npDoc); acDocManager->lockDocument(npDoc); acdbSetDbmod(npDoc->database(),0); acDocManager->unlockDocument(npDoc); acDocManager->closeDocument(npDoc) ; } else { npDocdwg1=npDoc; } } acDocManager->setCurDocument(npDocdwg1); acDocManager->activateDocument(npDocdwg1); delete pDocItr; |