高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】crash in setxdata
crash in setxdata
crash in setxdata
i have been trying to call oddbobject::setxdata just like in the example from dbfiller.cpp and every time the call fails. looking in the call stack reveals that null has been passed. what is going wrong?
in this case the object (which is valid) is a oddbaligneddimension object.
i am using ms visual studio c++ 6.0.
call stack before
setdimensionoverride(oddbobjectid & {...}) line 1322
call stack after
odxdata::setnextitem(unsigned int & 43, odxdata::item & {...}, oddbdatabase * 0x08ce2210) line 347
oddbobject::setxdata(const odresbuf * 0x00000000) line 1680
setdimensionoverride(oddbobjectid & {...}) line 1351 + 45 bytes
code
void setdimensionoverride(oddbobjectid& id)
{
oddbobjectptr pobject = id.safeopenobject(oddb::kforwrite);
odresbufptr xiter = odresbuf::newrb(1001);
odresbufptr prbuf = xiter;
prbuf->setstring("strakon-dstyle");
prbuf->setnext(odresbuf::newrb(1000));
prbuf=prbuf->next();
prbuf->setstring("strakon extended data");
//dimse1
prbuf->setnext(odresbuf::newrb(1070)); //70
prbuf=prbuf->next();
prbuf->setint16(75);
prbuf->setnext(odresbuf::newrb(1070));
prbuf=prbuf->next();
prbuf->setint16(1);
//dimse2
prbuf->setnext(odresbuf::newrb(1070)); //70
prbuf=prbuf->next();
prbuf->setint16(76);
prbuf->setnext(odresbuf::newrb(1070)); //70
prbuf=prbuf->next();
prbuf->setint16(1);
// Überschreibungen des dimstyles setzen
pobject->setxdata(xiter);
}
does "strakon-dstyle" application present in your drawing?
you can call oddbdatabase::newregapp("strakon-dstyle") to be sure (it will add the application if it is abcent).
sergey slezkin
|