crash in oddbhatch::numhatchlines
crash in oddbhatch::numhatchlines
hello forum,
if i run the following code onto the attached dwg, i get a crash in numhatchlines. my version is dwgdirect 2.4.1.
is there something wrongly set in my app or is it a bug ?
code:
blockrecord = database->getmodelspaceid().safeopenobject() ;
objectiterator = blockrecord->newiterator();
for(objectiterator->start() ; objectiterator->done() == false ; objectiterator->step())
{
oddbobjectptr obj = objectiterator->objectid().safeopenobject() ;
if(obj->iskindof(oddbhatch::desc()))
{
oddbhatchptr hatch = oddbhatch::cast(obj) ;
int n = hatch->numhatchlines() ;
}
}attached files
do you have crash or exception? if exception than of what kind?
what is the handle of problem hatch entity?
sergey slezkin
to reproduce my problem, you can open your odamfcappdll project 2.5.2 and paste my piece of code in codamfcappdoc:

nopendocument, just before the return.
use 'm_pdb' instead of 'database' and declare :
oddbblocktablerecordptr blockrecord
oddbobjectiteratorptr objectiterator
if you now open carrdbg2.dwg, you will get an debug assertion (see the attached jpeg) and the program will stop. i cannot get the entity handle.
if you comment the line
int n = hatch->numhatchlines() ;
there is no problem.
attached images (26.6 kb, 6 views)
last edited by jerome roche; 14th may 2008 at 06:53 amfff">.
i entered defect 5088 for it:
btw, members can enter defects directly to our bugzilla:
login is the same as for accessing web site.
bug reporter gets automatic e-mail notifications if bug status changes. you can add yourself to cc list of a bug.
sergey slezkin