几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(C++) (http://www.dimcax.com/hust/forumdisplay.php?f=34)
-   -   【转帖】[求助]插入图形出错 (http://www.dimcax.com/hust/showthread.php?t=6877)

yang686526 2009-04-16 04:47 PM

【转帖】[求助]插入图形出错
 
[求助]插入图形出错
[求助]插入图形出错
用下列代码可以成功插入一个ydphb.dwg图,可是关闭图纸的时候就出错。请问什么原因,谢谢
acgematrix3d mat;
mat.settoidentity();
mat.settotranslation(acgevector3d(inpoint[x],inpoint[y],inpoint[z]));
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之类的东西?


所有的时间均为北京时间。 现在的时间是 08:49 PM.