AutoCAD2008中始终创建空白文件失败。谁能知诉我错在哪里? // 创建一张新图纸 LPDISPATCH pDispatch = acedGetAcadWinApp()->GetIDispatch(TRUE); IAcadApplication *acadApp = NULL; HRESULT hr = S_OK; hr = pDispatch->QueryInterface(IID_IAcadApplication, (LPVOID*)&acadApp); if (FAILED(hr)) return; IAcadDocuments* pDocs; acadApp->get_Documents(&pDocs); IAcadDocument* pacadDoc; VARIANT varTemplate; ::VariantInit(&varTemplate); varTemplate.vt = VT_BSTR; varTemplate.bstrVal = _bstr_t(g_sPath/*Arx文件路径*/) + _bstr_t("Template\\acadiso.dwt"); ads_printf(varTemplate.bstrVal); hr = pDocs->Add(varTemplate, &pacadDoc); // ???这句代码执行返回结果失败,不能创建空白的图形文件 /* pDocs->Add(vtMissing, &pacadDoc); // 在AutoCAD2000中正常执行代码*/ if (FAILED(hr)) { ads_printf(_T("创建空白的图形文件失败。\n")); return; } |