几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量  


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


 
 
主题工具 搜索本主题 显示模式
旧 2009-05-04, 03:30 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】access violation loading dxf file

access violation loading dxf file
access violation loading dxf file
using the attached .dxf file and .shx file, i get an access violation when i open and attempt to draw. the .dxf file will display without the .shx file. i have reproduced the problem in odamfcapp. i am using version 1.13.0. most/all text should be displayed using japanese characters (with the .shx file). this does work correctly using the old opendwg viewkit, which we are replacing with dwgdirect. here is the stack:
oddbfontservices::loadstylerec(odgitextstyle & {...}, oddbdatabase * 0x05d24e20) line 188 + 20 bytes
odgitextstyle::loadstylerec(oddbdatabase * 0x05d24e20) line 48 + 32 bytes
gifromdbtextstyle(const oddbtextstyletablerecord * 0x05d2d0e0, odgitextstyle & {...}) line 97 + 25 bytes
gifromdbtextstyle(oddbobjectid {...}, odgitextstyle & {...}) line 85 + 18 bytes
oddbtextimpl::worlddraw(odgiworlddraw * 0x05c15a80, const char * 0x05d39fdc, const char * 0x00000000) line 772 + 27 bytes
oddbtext::worlddraw(odgiworlddraw * 0x05c15a80) line 766 + 29 bytes
odgibasevectorizer::dodraw(unsigned long 1, const odgidrawable * 0x05d38a70) line 810 + 17 bytes
odgsbasevectorizeview::dodraw(unsigned long 1, const odgidrawable * 0x05d38a70) line 2093
odgibasevectorizer::draw(const odgidrawable * 0x05d38a70) line 769 + 34 bytes
odgsentitynode::update(odgsbasevectorizeview & {...}, odgscontainernode * 0x05d24720) line 867 + 49 bytes
odgscontainernode::update(odgsbasevectorizeview & {...}, odgscontainernode * 0x00000000) line 605 + 21 bytes
odgsbasevectorizeview::display(unsigned char 1) line 1599 + 19 bytes
odgsbasevectorizeview::update() line 1661 + 18 bytes
exgdivectorizeview::update() line 307
odgsbasevectorizedevice::update(odgsdcrect * 0x00000000) line 193 + 16 bytes
exgsgdivectorizedevice::update(odgsdcrect * 0x00000000) line 127
odgsmodellayouthelperimpl::update(odgsdcrect * 0x00000000) line 386 + 31 bytes
cdwgviewer:aint() line 215 + 38 bytes
cdwgviewer::drawerthread() line 265
cdwgviewer::_drawerthread(void * 0x065259f0) line 204
kernel32! 7c80b50b()
attached files
i can't reproduce the situation in 1.13.0, 1.12.04, 1.14.01
does it happen always on your computer, what are exactly the steps to reproduce it in odamfcapp?
sergey slezkin
1. put the .dxf and .shx files in the same directory.
2. run odamfcapp.
3. file->open and select the .dxf file.
4. click on vectorize button. <-- crash happens here.
if i delete/move/rename the .shx file and follow the same steps, the file displays fine (after doing a zoom extents), but most of the text displays as question marks.
the same crash happens in our application when i try to use the .shx file. that is why i tried (and did) to reproduce the problem in odamfcapp.
by the way, i am using wingdi to render, if that is important.
last edited by wageoghe; 4th january 2006 at 04:16 pmfff">.
sergey, please look!
i have debugged this problem using the dwgdirect source code and here is what i have found:
there is some in dbfontservices.cpp called oddbfontservices::loadstylerec. this function tries to resolve the font information from the input odgitextstyle object (style). there is a lot of stuff about getting the preferable font and lookin for a substitute font. eventually, it starts looking for the font using findfile. finally, control gets to this code:
// big font
if (!style.bigfontfilename().isempty())
{
odstring filename = getbigfontfilepath(style, pdb);
if ( filename.isempty() )
style.setbigfont(0);
else
{
style.setbigfont(odfonttable::getfont(filename));
if ( style.getfont()->isshxfont() )
((odshxfont*)style.getbigfont())->setmainshxfont(((odshxfont*)style.getfont()));
}
}
else
style.setbigfont(0);
in my case ( land1.dxf, bigfont.shx in same directory ), style.bigfontfilename is not empty, so it goes in the if block. getbigfontfilepath does find bigfont.shx in the same directory as the dxf file, so it goes to the line that calls setbigfont. the crash is happening on the next line:
if ( style.getfont()->isshxfont() )
at this point, when i step into style.getfont(), i can see that m_pfont is not pointing to anything ( m_pobject is 0x00000000 ). control then returns to loadstylerec and the reference returned by style.getfont() tries to call isshxfont(). unfortunately, style.getfont() is not returning a reference. perhaps, in the case of a bigfont, style.getbigfont() should be used?
this is fixed in 1.14. if you need to fix 1.13 you can move the fix from your 1.14 sources to 1.13
sergey slezkin
that fixed the problem. thanks!
i really appreciate the prompt support that we usually receive in this forum.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】problem importing dxf file in sw2008 sp 4.0 - but no problem yang686526 SolidWorks二次开发 0 2009-04-13 01:34 PM
【转帖】create dxf macro yang686526 SolidWorks二次开发 0 2009-04-13 10:00 AM
【转帖】auto create 11 flat pattern and save as dxf yang686526 SolidWorks二次开发 0 2009-04-13 09:08 AM
【转帖】how to save to dxf in active drawing file location yang686526 SolidWorks二次开发 0 2009-04-12 09:23 PM


所有的时间均为北京时间。 现在的时间是 06:48 PM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多