static char pData[]="d:\\22.dwg"; acDocManager->executeInApplicationContext(createdoc,(void* )pData);
AcApDocument *pDoc=NULL;
AcApDocManager *pDocMgr = acDocManagerPtr(); AcApDocumentIterator *pDocItr; pDocItr = pDocMgr->newAcApDocumentIterator(); // AcApDocument *pDoc=NULL; CString ThisFilename;//="d:\\22.dwg";
for(;!pDocItr->done();pDocItr->step()) { pDoc = pDocItr->document(); ThisFilename = pDoc->docTitle(); acutPrintf("\n"+ThisFilename); if(strcmp(pData,ThisFilename)==0)//pData是要关闭的文档的name { acutPrintf("\n 文件关闭!"); pDocMgr->closeDocument(pDoc); } }
用executeInApplicationContext()打开的cad文档不能成为当前文档?
|