几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】crash in setxdata (http://www.dimcax.com/hust/showthread.php?t=15533)

yang686526 2009-05-04 06:33 PM

【转帖】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


所有的时间均为北京时间。 现在的时间是 11:33 AM.