高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】critical readfile problem in v1.09
critical readfile problem in v1.09
critical readfile problem in v1.09
readfile throws an "invalid index" exception if an r13 dwg is loaded.
i use the system services implementation in the examples/borland c++ builder 6.0.
this problem can be repeted by simply drawing 1 circle in a drawing (i did it in autocad 2002) and save it as r13 dwg. this drawing is then not possible to load with dwgdirect? or?
(i tried an r13 dxf, which failed with another critical error as well, however r14 and r12 works fine)
robert persson
rob
what dd version do you use? initial 1.09 (october) or updated (november). could you post or e-mail me the problem files?
sergey slezkin
i attached a file with my first post but it didnt seem to work (?)...can i mail it somewhere? i use the latest dd (when i fell into trouble i updated to the latest)
robert
ps: i attach a dwg this time to and we'll see if it works or not...
attached files (27.4 kb, 7 views)
rob
both odamfcapp and odreadex samples loaded your file successfuly. i used release build of stuff downloaded from oda site today. (other older versions i tried work too.) can you reproduce the crash in odreadex sample?
sergey slezkin
i havent recompiled odreadex, but my code does quite much the same. here's the start my code that loads a dwg:
int loaddwg(char* filename) {
odrxobjectimpl<myservices> svcs;
odinitialize(&svcs);
oddbdatabaseptr pdb;
non_planar_entities=false; //set to true if any entites not in xy plane is encountered
#define dwgerror() {oduninitialize();return 0;}
try {
// open the file
pdb = svcs.readfile(filename,false, false,oda::ksharedenywrite);
if(pdb.isnull())
dwgerror();
........
this code crashes with an exception in readfile, saying 'invalid index'
one intresting thing to note is some warnings i get when compiling, using the ex... files from examples folder:
[c++ warning] exhostappservices.h(58): w8022 'exhostappservices::warning(odstring)' hides virtual function 'oddbhostappservices::warning(odresult)'
[c++ warning] exhostappservices.h(58): w8022 'exhostappservices::warning(odstring)' hides virtual function 'oddbhostappservices::warning(odresult,oddbobjecti d)'
[c++ warning] exhostappservices.h(58): w8022 'exhostappservices::readfile(const char *,bool,bool,oda::filesharemode,const odwstring &)' hides virtual function 'oddbhostappservices::readfile(odstreambuf *,bool,bool,const odwstring &)'
one more thing that should be known, is that this project is an dll file, which works as an dwg loader plugin for a small cad system.
is there maybe any defines i should use becaus i use borland compiler and/or that i compile a dll file????
rob.
rob
|