且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当我不使用调试器时收到错误消息

更新时间:2022-10-15 16:58:59

I assume you can reproduce the problem, that is: when running executable along there is no exception, when back to debugger, you see exception.

From your information, I cannot tell the exact reason of the exception, so I''m trying to guess why the difference between running under debugger and from executable. First of all, you did not describe how exactly "error message" is shown.

One possible scenario is: there is no "error message", and the always application goes normally, under debugger or not, but in the middle if run-time exception is thrown; and exception handler takes this into account; and propagation of this exception further up to stack is not done (there is no re-throw or throwing another exception in the catch block).
For example, if the DLL you use to obtain icon is not found; so these icons are not used, but it still allows application to run. Why not? -- reasonable enough. Only you can sort out what exactly happens.

What you see under debugger can be just the debugger break point at this exception. It is not supposed to be shown during normal run-time (because exception handler suppress propagation), but the debugger is tuned to break execution at some or all exceptions, which let you to continue execution. The point of throwing or catching exception works like a break point. (This is optional, see below.)

When the debugger breaks at the exception, it shows exception message. This is not quite the same as "error message". You can control the set of this useful debugger options in VS via Debug -> Exceptions... window. For experiment, try to switch everything off (so the debugger won''t break at the point where some kind of exception is thrown or caught) and see if your "error message" disappears. Don''t forget that this in important debugger feature, so set this option properly -- it can help you a lot.


The MSDATL3.DLL file is associated with the data access components. Did you install/uninstall something recently?