yinyan168 发表于 2007-9-6 17:53:00

[求助]插入图形出错

用下列代码可以成功插入一个ydphb.dwg图,可是关闭图纸的时候就出错。请问什么原因,谢谢
AcGeMatrix3d mat;
mat.setToIdentity();
mat.setToTranslation(AcGeVector3d(inPoint,inPoint,inPoint));
AcDbDatabase *pNewDb=new AcDbDatabase(Adesk::kFalse);
CString sFileName;
acedFindFile("ydphb.dwg",sFileName.GetBuffer());
sFileName.ReleaseBuffer();
es=pNewDb->readDwgFile(sFileName, _SH_DENYWR,false);
if (es!=Acad::eOk)
{
   acutPrintf("\nThe file %s cannot be opend!\n",sFileName);
   CompleteEditorCommand();
   acDocManager->unlockDocument(curDoc());
   return;
}
AcDbDatabase *pDb;
pDb =acdbHostApplicationServices ()->workingDatabase () ;
pDb->insert(mat, pNewDb);

MIRRO 发表于 2007-11-6 20:30:00

new了一个东西之后,是不是要有个对应的处理啊?诸如delete之类的东西?
页: [1]
查看完整版本: [求助]插入图形出错