用向导创建一个ARX程序,现在就面临最后的close 但是不知道怎么close 。 编译能通过,但是在AutoCAD里面运行的话,就会导致CAD发生致使错误而关闭
请问 ,如何关闭?
附:源程序
//设定直线的两个端点 //并创建一个指向对象的指针 AcGePoint3d p1Start(50,20,0),p2Start(50,40,0), p3Start(50,60,0),p4Start(158,80,0),pxStart(100,0,0); AcGePoint3d p1End(150,20,0),p2End(150,40,0), p3End(150,60,0),p4End(150,80,0),pxEnd(100,100,0);
AcDbLine *p1l=new AcDbLine(p1Start,p1End);
AcDbLine *p2l=new AcDbLine(p2Start,p2End);
AcDbLine *p3l=new AcDbLine(p3Start,p3End); AcDbLine *p4l=new AcDbLine(p4Start,p4End);
AcDbLine *pxl=new AcDbLine(pxStart,pxEnd);
////直线的块表指针 AcDbBlockTable *p1BT,*p2BT,*p3BT,*p4BT,*pxBT;
acdbHostApplicationServices()->workingDatabase() ->getBlockTable(p1BT,AcDb::kForRead);
acdbHostApplicationServices()->workingDatabase() ->getBlockTable(p2BT,AcDb::kForRead);
acdbHostApplicationServices()->workingDatabase() ->getBlockTable(p3BT,AcDb::kForRead);
acdbHostApplicationServices()->workingDatabase() ->getBlockTable(p4BT,AcDb::kForRead);
acdbHostApplicationServices()->workingDatabase() ->getBlockTable(pxBT,AcDb::kForRead);
//直线的块表记录的指针 AcDbBlockTableRecord *p1BTR,*p2BTR,*p3BTR,*p4BTR,*pxBTR;
p1BT->getAt(ACDB_MODEL_SPACE,p1BTR,AcDb::kForWrite);
p2BT->getAt(ACDB_MODEL_SPACE,p2BTR,AcDb::kForWrite);
p3BT->getAt(ACDB_MODEL_SPACE,p3BTR,AcDb::kForWrite);
p4BT->getAt(ACDB_MODEL_SPACE,p4BTR,AcDb::kForWrite);
pxBT->getAt(ACDB_MODEL_SPACE,pxBTR,AcDb::kForWrite);
//线 将AcDbLine类的对象添加到块表记录中 AcDbObjectId l1Id,l2Id,l3Id,l4Id,lxId;
p1BTR->appendAcDbEntity(l1Id,p1l); p2BTR->appendAcDbEntity(l2Id,p2l); p3BTR->appendAcDbEntity(l3Id,p3l); p4BTR->appendAcDbEntity(l4Id,p4l); pxBTR->appendAcDbEntity(lxId,pxl);
/////收尾工作////////
// 关闭第一个图形数据库的各种对象 p1BT->close(); p1l->close;
p2BT->close(); p2l->close();
p3BT->close(); p3l->close();
p4BT->close(); p4l->close();
pxBT->close(); pxl->close();
|