几何尺寸与公差论坛------致力于产品几何量公差标准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:32 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】access violation

access violation
access violation
in the exhostappservices.cpp there is a place that i get an access violation enumerating the registry. i get the error code error_no_more_items, but it is not catered for and the variables nvalnamesize and ndatasize are both 0.
previous code is
do
{
tchar* lpvalname = new tchar[nvalnamesize];
lpbyte lpdata = new byte[ndatasize];
nres = ::regenumvalue(hfonts, nindex, lpvalname, &nvalnamesize, null, null, lpdata, &ndatasize);
if(nres == error_more_data)
{
nvalnamesize += 20;
}
else
{
svaluename = lpvalname;
filename = (lpctstr)lpdata;
}
delete lpvalname;
delete lpdata;
}
while(nres == error_more_data);
i suggest we change to
do
{
tchar* lpvalname = new tchar[nvalnamesize];
lpbyte lpdata = new byte[ndatasize];
nres = ::regenumvalue(hfonts, nindex, lpvalname, &nvalnamesize, null, null, lpdata, &ndatasize);
if(nres == error_more_data)
{
nvalnamesize += 20;
}
else if( nres == error_success)
{
svaluename = lpvalname;
filename = (lpctstr)lpdata;
}
delete lpvalname;
delete lpdata;
}
while(nres == error_more_data);
else the line filename = (lpctstr) lpdata access violates. (it access violates some where in odstring, and hence i dont have source for there so i have to leave you gurus to make the correct decision.
also to help you : the call stack is as follows :
activextest.ocx!odansistring:dansistring() + 0x19
activextest.ocx!odstring:dstring() + 0x54
activextest.ocx!odstringerator=() + 0x28
> activextest.ocx!exhostappservices::ttffilenamebyde scriptor(const odttfdescriptor & descr={...}, odstring & filename={...}) line 293 c++
activextest.ocx!oddbfontservices::loadstylerec() + 0x61a
activextest.ocx!odgitextstyle::loadstylerec() + 0xb4
activextest.ocx!odmtextiterator::changefont() + 0x449
activextest.ocx!odmtextiterator:rocess() + 0x896
ntdll.dll!7c9106eb()
ntdll.dll!7c911596()
ntdll.dll!7c911596()
ntdll.dll!7c9106eb()
ntdll.dll!7c911538()
ntdll.dll!7c911596()
ntdll.dll!7c9106eb()
ntdll.dll!7c911596()
ntdll.dll!7c911596()
ntdll.dll!7c9106eb()
ntdll.dll!7c910732()
ntdll.dll!7c9106ab()
ntdll.dll!7c910d5c()
ntdll.dll!7c910f46()
ntdll.dll!7c960af8()
ntdll.dll!7c960bcc()
ntdll.dll!7c960af8()
ntdll.dll!7c960bf0()
ntdll.dll!7c960bcc()
ntdll.dll!7c91056d()
msvcrtd.dll!_free_base(void * pblock=0x00000009) line 96 c
msvcrtd.dll!_free_dbg(void * puserdata=0x01a70110, int nblockuse=1) line 1006 + 0x7 c
msvcrtd.dll!free(void * puserdata=0x7c9180ff) line 956 + 0xb c
ntdll.dll!7c90d4ea()
ntdll.dll!7c9180ff()
ntdll.dll!7c90d4ea()
ntdll.dll!7c9180ff()
ntdll.dll!7c911596()
ntdll.dll!7c9106eb()
ntdll.dll!7c911596()
ntdll.dll!7c9106eb()
ntdll.dll!7c911596()
ntdll.dll!7c911596()
ntdll.dll!7c9106eb()
ntdll.dll!7c912270()
ntdll.dll!7c911596()
ntdll.dll!7c9106eb()
also as a side note: this fixed a memory corruption i was having on 2- 3 machines in the test office. as in the previous threads i posted previously :
we fixed it so:
code:
do
{
tchar* lpvalname = new tchar[nvalnamesize];
lpbyte lpdata = new byte[ndatasize];
nres = ::regenumvalue(hfonts, nindex, lpvalname, &nvalnamesize, null, null, lpdata, &ndatasize);
if (nres == error_more_data)
{
nvalnamesize += 20;
}
else if (nres == error_success)
{
svaluename = lpvalname;
filename = (lpctstr)lpdata;
}
else
{
svaluename.empty();
filename.empty();
}
delete lpvalname;
delete lpdata;
}
while (nres == error_more_data);
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】access violation while exploding block reference yang686526 DirectDWG 0 2009-05-04 03:31 PM
【转帖】access violation on oddb3dpolyline yang686526 DirectDWG 0 2009-05-04 03:31 PM
【转帖】access violation crash in recoverfile9file.dxf0 yang686526 DirectDWG 0 2009-05-04 03:29 PM
【转帖】access violation at program exi yang686526 DirectDWG 0 2009-05-04 03:29 PM
【转帖】(access violation reading 0xcccccccc)在线等呢 yang686526 ObjectARX(C++) 0 2009-04-14 02:29 PM


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


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