几何尺寸与公差论坛------致力于产品几何量公差标准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, 07:06 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】dd2.1.0 cant support wchar filename,it leads to a crash

dd2.1.0 can't support wchar filename,it leads to a crash
dd2.1.0 can't support wchar filename,it leads to a crash
i rebuilded my old progam at dd2.1.0 and run it. i found the files with chinese name could't be open, and the program crashed in a sentence in "\dd_nonlibs\extensions\exservices\odfilebuf.c pp" :
{
m_sfilename = sfilename;
}
m_sfilename and sfilename are odstring objects.
if it was be build at dd1.13 will be ok.
what is sfilename?, what is the current locale? is your program unicode or not?
vladimir
dd2.1.0 can't support wchar filename,it leads to a crash
hi wvk,
the part code is that:
code:
#ifdef dd_unicode
odstring sfilename = wszfilename;
#else
odstring sfilename = odwidechartostring((lpcwstr)wszfilename);
#endif //dd_unicode
m_hfile = ::createfilew(wszfilename, dwaccess, dwshare, null, dwdisposition, dwattr, null);
if( m_hfile == invalid_handle_value )
{
oda_trace1(dd_t("open() can't open file, getlasterror = %x"), ::getlasterror());
throw oderror_fileexception(ecantopenfile, sfilename);
}
else
{
m_sfilename = sfilename;
m_ifileshare = nsharemode;
}
sorry i made a mistake, the crash happened on "throw oderror_fileexception(ecantopenfile, sfilename);",not on the lines under it.-_-|
wszfilename is also a odstring variable, it's a function param transformed from "lpszpathname" of cdocument:nopendocument(lpctstr lpszpathname). my program isn't unicode, and thanks for your remind, i found a "dd_unicode" defined in odadefs.h in dd2.1.0 but not in dd1.13.
don't you think it's new vision's bug? because the program worked good with the old version.
step through the code, see how the string is converted. dump unicode string passed to createfilew.
try to build odamfcappdll "debug - non unicode" configuration, see if it works.
vladimir
i built odamfcappdll but it couldn't run. there was a error report that says can't find program entry reverseparam.... on dd_ge.dll. so i built odamfcapp "debug - non unicode" instead. it ran but when i open "e:\文字.dwg", it report:can't open file "e:\". step in and found the value in odstring's unitcodebuffer is just "e:\". it looks like the odstring's converting process is not right.
possible it is bug with conversion to unicode with undefined codepage.
try to initialize odstring like
odstring filename ( "e:\\文字.dwg", cp_ansi_936 ); // string must be in mbcs coding
filename.getlenght(); // force conversion to unicode
and see unicodebuffer of odstring.
best regards,
sergey z.
thanks, after forcing conversion, the program can open files with chinese name now. hope the bug can be resolved in next dd version.
last edited by willasw; 22nd november 2006 at 09:16 pmfff">.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】crash in release mode yang686526 DirectDWG 0 2009-05-04 06:32 PM
【转帖】borland support dropped yang686526 DirectDWG 0 2009-05-04 04:58 PM


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


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