473,503 Members | 5,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

try/catch versus runtime error dialog

Hi all,

Maybe someone can help me with this:

My C++ project contains try and catch blocks. A catch-all block triggers my
custom message box with some information on the error caught. The stacktrace
is written to a log file. While stepping through my application from within
the IDE everything works fine. However, when i start my application outside
the IDE (which is an MS Outlook plugin, by the way) i receive this annoying
"Microsoft Visual C++ Runtime Library" error dialog telling me of a "Runtime
Error!". It seems that my catch block is ignored!

A google search, unfortunately, only turned up a reference to the function
set_terminate() which allows me to redirect the exception handling before,
again, this runtime dialog fires.

Is there a method (compiler switches, Macros, includes, library imports
whatever) which prevents this ugly message box to appear?

regards,

Lennart
Mar 2 '06 #1
1 1835
....setting -EHa compiler option and including #include <excpt.h> did the job.

"Lennart" wrote:
Hi all,

Maybe someone can help me with this:

My C++ project contains try and catch blocks. A catch-all block triggers my
custom message box with some information on the error caught. The stacktrace
is written to a log file. While stepping through my application from within
the IDE everything works fine. However, when i start my application outside
the IDE (which is an MS Outlook plugin, by the way) i receive this annoying
"Microsoft Visual C++ Runtime Library" error dialog telling me of a "Runtime
Error!". It seems that my catch block is ignored!

A google search, unfortunately, only turned up a reference to the function
set_terminate() which allows me to redirect the exception handling before,
again, this runtime dialog fires.

Is there a method (compiler switches, Macros, includes, library imports
whatever) which prevents this ugly message box to appear?

regards,

Lennart

Mar 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
5966
by: Noor | last post by:
please tell the technique of centralize exception handling without try catch blocks in c#.
11
6862
by: kaeli | last post by:
Hey all, I'd like to start using the try/catch construct in some scripts. Older browsers don't support this. What's the best way to test for support for this construct so it doesn't kill...
11
3458
by: Pohihihi | last post by:
I was wondering what is the ill effect of using try catch in the code, both nested and simple big one. e.g. try { \\ whole app code goes here } catch (Exception ee) {}
37
2912
by: clintonG | last post by:
Has somebody written any guidelines regarding how to determine when try-catch blocks should be used and where their use would or could be considered superfluous? <%= Clinton Gallagher...
7
1812
by: AC [MVP MCMS] | last post by:
Wierd situation here. Running ASP.NET 1.1 on Win2003. I have to manually attach the debugger to a process in order to debug. So I set a breakpoint in an obvious place (like within the Page.Load...
2
2539
by: Sam Miller | last post by:
Normally the debugger (visual studio .net environment) is good at pointing out the line of code that caused an exception.... except when that code is executed as part of a timer handler. In the...
7
1218
by: James Radke | last post by:
Hello, I have a module which has the flow as follows Private sub trysomething() Try if something.... ... some code
2
1889
by: CodeSlayer | last post by:
Hi all, This one really has me and the other .Net developers at my work stumped. I have an application that is doing the following: 1 - attempt to validate that user can create a windows task...
0
7063
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7258
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7313
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6970
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7441
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5558
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1489
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.