- 积分
- 815
- 明经币
- 个
- 注册时间
- 2004-10-8
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2005-3-9 10:21:00
|
显示全部楼层
static char pData[] = "C:\\test.dwg";
void openSyncDoc() { AcApDocument* pDoc = acDocManager->curDocument(); if (pDoc) { acutPrintf("\nCurrently in Document context : %s, Switching to App.\n",pDoc->fileName()); acDocManager->executeInApplicationContext(openSyncDocHelper, (void *)pData); } acDocManager->activateDocument(pDoc); acDocManager->closeDocument(pDoc); }
void openSyncDocHelper( void *pData) { AcApDocument* pDoc = acDocManager->curDocument(); if (acDocManager->isApplicationContext()) { acutPrintf("\nSucessfully Switched to App. Context\n"); acDocManager->appContextOpenDocument((const char *)pData); acutPrintf("\nOpened a document synchronously:%s.\n", (const char *)pData); } else acutPrintf("\nERROR: in Document context : %s\n",pDoc->fileName()); } |
| |
|