[求助]插入图形出错
用下列代码可以成功插入一个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);
new了一个东西之后,是不是要有个对应的处理啊?诸如delete之类的东西?
页:
[1]