查看单个帖子
旧 2009-05-04, 06:50 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】creator objects another one

creator objects another one
creator objects another one
is correct this code?
oddbblocktablerecordptr pstable = getmodelspaceid().safeopenobject(oddb::kforwrite);
oddblineptr pent = new oddbline();
id= pstable->appendoddbentity(pent);
i think so - but only if:
oddblineptr pent = oddbline::createobject();
and
oddblineptr pent = new oddbline();
are code equivalents, then it should be fine.
i would recommend to use oddbline::creteobject() not "new oddbline". it's more safe. dd is responsible for disposing entities from database so let it create them. else problems may occur if dd and your application use different heaps.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)