|
马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如题,查找并试了一些方法:
1)static char pData[] = "E:\\图纸\\autoCAD\\test.dwg";
acDocManager->executeInApplicationContext(OpenDoc, (void *)pData);
void OpenDoc( void *pData)
{
AcApDocument* pDoc = acDocManager->curDocument();
if (acDocManager->isApplicationContext())
{
acDocManager->appContextOpenDocument((const ACHAR *)pData);
}
else
{
//acutPrintf("\nERROR To Open Doc!\n");
}
}
2)LPCSTR lpDocPath= "E:\\图纸\\autoCAD\\test.dwg";
LPDISPATCH pAcadDisp = acedGetIDispatch(TRUE);
hr = pAcadDisp->QueryInterface(AutoCAD::IID_IAcadApplication,(void**)&pAcad);
pAcad->get_Documents(&pDocs);
VARIANT vReadOnly,vPassWord;
VariantInit(&vPassWord);
VariantInit(&vReadOnly);
hr = pDocs->Open((BSTR)lpDocPath,vReadOnly,vPassWord,&pDoc);
3)
Acad::ErrorStatus g = acDocManagerPtr()->appContextOpenDocument((ACHAR *)lpDocPath);
4)
Acad::ErrorStatus s;
s = acedSyncFileOpen((ACHAR *)lpDocPath);
调试了 都没有打开指定文档,返回值是eNotApplicable
请问如何能够正确打开指定路径图纸,望指点!谢谢
|
|