请教
<P>void CreateDh()<BR>{AcDbDatabase *pCurDb;<BR> pCurDb=acdbHostApplicationServices()->workingDatabase();<BR> AcDbBlockTable * pBlockTable;<BR> pCurDb->getBlockTable(pBlockTable,AcDb::kForRead);<BR> AcDbBlockTableRecord * pBlockTableRecord;<BR> pBlockTable->getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite);<BR> pBlockTable->close();<BR> AcDbObjectId DhId;</P><P> double x,y,z;<BR> int Count=Pointx.GetSize();<BR> for(int i=0;i<Count;i++)<BR> {x=atof(Pointx.GetAt(i));<BR> y=atof(Pointy.GetAt(i));<BR> z=atof(PointGc.GetAt(i));<BR>AcGePoint3d Pt(x,y,z);<BR> <BR>AcDbPoint * Dh= new AcDbPoint(Pt);</P>
<P><BR> pBlockTableRecord->appendAcDbEntity(DhId,Dh);<BR> <BR>}<BR>pBlockTableRecord->close();</P>
<P>}</P>
<P>为什么我这段代码有错误 在CADA2002运行后出现问题是不是没有关闭对象但是我加入Dh->close() 语句VC编译通不过 不光是AcDbPoint AcDbText ->close()也不行我看书上例子写有这些关闭对象的语句为什么我搬过来就不行 指教!!</P>
reply
Pointx的定义在哪里? <P>至于POINTX等定义都不是问题 主要是我写Dh->close()就不能通过,为什么我这句实体关闭语句错误? 如果不把实体对象关闭会有什么严重后果??</P> 不能通过提示什么错误? <P>我写了对象关闭 Dh->close()后编译出现如下错误 请斑竹看看</P><P>error C2065: 'Dh' : undeclared identifier<BR>error C2227: left of '->close' must point to class/struct/union</P> <P>文件开头处加上#include "dbents.h"试试。</P> <P>加了VC6.0编译 构件ARX都通过了 没任何错误 CAD下执行后不行</P>
页:
[1]