[求助]插入图形出错
<p>用下列代码可以成功插入一个ydphb.dwg图,可是关闭图纸的时候就出错。请问什么原因,谢谢</p><p>AcGeMatrix3d mat;<br/>mat.setToIdentity();<br/>mat.setToTranslation(AcGeVector3d(inPoint,inPoint,inPoint));</p><p> AcDbDatabase *pNewDb=new AcDbDatabase(Adesk::kFalse);</p><p> CString sFileName;<br/> acedFindFile("ydphb.dwg",sFileName.GetBuffer());<br/> sFileName.ReleaseBuffer();<br/> es=pNewDb->readDwgFile(sFileName, _SH_DENYWR,false); <br/> if (es!=Acad::eOk) <br/> { <br/> acutPrintf("\nThe file %s cannot be opend!\n",sFileName); <br/> CompleteEditorCommand();<br/> acDocManager->unlockDocument(curDoc());<br/> return; <br/> }<br/> AcDbDatabase *pDb; <br/> pDb =acdbHostApplicationServices ()->workingDatabase () ; <br/> pDb->insert(mat, pNewDb);</p> <p>new了一个东西之后,是不是要有个对应的处理啊?诸如delete之类的东西?</p>
页:
[1]