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

[求助]插入图形出错

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

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

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