马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
Close all documents including the current one
By Balaji Ramamoorthy
The sample code closes all documents, including the current one by first closing all documents except the current one in the document context. The current document is then closed from the application context using the executeInApplicationContext API. This allows the current document to be closed from the same command which is running in the document context.
- // Close the other documents
- AcApDocumentIterator *Iter
- = acDocManager->newAcApDocumentIterator();
- while(!Iter->done())
- {
- if (Iter->document()!=acDocManager->curDocument())
- {
- acDocManager->closeDocument(Iter->document());
- }
- Iter->step();
- }
- delete Iter;
- // Now close the current document
- ::acDocManagerPtr()->appContextCloseDocument
- (acDocManager->curDocument());
|