📄 subject_43652.htm
字号:
<p>
序号:43652 发表者:pansm 发表日期:2003-06-12 20:14:25
<br>主题:高手,HELP ME!!!!!!!!!!
<br>内容:我想捕捉程序运行过程中产生的异常错误,目前我已经或渠到了异常,但是我不知道如何从系统给我的异常信息里提起出我需要的代码段、模块明等信息,急盼高手指点迷津!!<BR><BR>附系统提供的信息结构:_EXCEPTION_POINTERS *ExceptionInfo
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:Neil Gan 回复日期:2003-06-14 05:15:23
<br>内容:you can get the exception address from ExceptionInfo.then, you can use Toolhelp api to get which module the address locates:<BR><BR>CreateToolhelp32Snapshot,Module32First,Module32Next
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:pansm 回复日期:2003-06-14 14:47:12
<br>内容:非常感谢你的答复,不过我还有一点疑问:若这样判断出来的模块并不属于我自己书写的模块,而是MFC的动态库等,我又如何回溯到我自己的模块呢?另外在所提供的异常结果中,哪写是表明代码段的呢?我比较愚笨,再次感谢您的答复!!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:Neil Gan 回复日期:2003-06-15 00:34:26
<br>内容:请查询MSDN->GetExceptionInformation<BR><BR>in EXCEPTION_POINTERS->CONTEXT, there are all the register values when exception occured.<BR><BR>you should print some content of current stack to a debug file. using it, you can know who calls this function, that is, the "call stack".<BR><BR>If you want to use the CONTEXT struture, you need the knowledge of assembler.
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -