本文介绍了有条件的定义以抑制Delphi 6 Pro中的IDE拦截异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我可以使用Delphi Pro 6中的IDE设置来阻止IDE拦截和处理Delphi异常(停止程序并进入Debug模式),但是不幸的是,对于所有异常都关闭了该处理.我没有源代码的DLL中发生了访问冲突异常.我想知道是否有一个条件符号我不知道我可以在有问题的代码块周围定义/取消定义,以便至少我可以在该代码块周围关闭异常处理.如果不是,也许有一些技巧或技术可以做到这一点?

I know I can use the IDE settings in Delphi Pro 6 to stop the IDE from intercepting and handling Delphi Exceptions (stopping the program and entering Debug mode), but unfortunately that turns off that handling for all Exceptions. The Access Violation Exception is happening in a DLL that I don't have the source code for. I was wondering if there is a conditional symbol I don't know about that I could define/undefine around the offending code block so at least I could turn off Exception handling around that code block. If not, perhaps some trick or technique to do so?

推荐答案

编译器指令控制编译器和链接器如何将源代码转换为可执行代码.调试指令没有存储在DCU或二进制文件中,因此编译器指令无法控制您要执行的操作.

Compiler directives control how the compiler and linker turn your source code into executable code. Debugging instructions aren't stored in the DCU or the binary, so compiler directives can't control what you're after.

有几种方法可以控制异常处理.我已经在我几年前写的文章中进行了描述:

There are several ways to control exception handling. I've described them in an article I wrote a few years ago:

  • 使用高级断点"定义调试器应在哪里启动或停止异常中断.
  • 定义调试器将始终忽略的某些异常类.
  • 禁用异常停止功能.
  • 完全禁用调试.

这篇关于有条件的定义以抑制Delphi 6 Pro中的IDE拦截异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 04:45