473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Catching standard library exceptions in managed code

Hello,

I have a mixed dll which has to catch standard c++ library exceptions. Now I
understand that when *any* object is thrown as an exception in managed c++,
it is wrapped as a SEHException class instance. This seems to be the case
with the standard c++ library that is thrown.

It also seems to be the case that if you have a catch statement to catch any
scl exceptions that are thrown and you put this catch statement before the
cls Exception catch, your scl exception will be caught.

The *problem* is that while I can catch my scl exceptions, they seem to have
been munged in the process of wrapping them in the SEHException. I cannot
inspect the cause of the error by calling the what() function - I get an
'Unknown Exception' message back.

Is there any solution to this problem? Can I set a switch to prevent my scl
exception from being wrapped? I know I can't get anything from the Message
property of the SEHException that wraps my scl exception - all that I see
there is "External component has thrown an exception".

TIA,

--
Akin

aknak at aksoto dot idps dot co dot uk
Nov 17 '05 #1
0 797

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

Similar topics

17
by: Bryan Bullard | last post by:
hi, is there a way to force the user of an object to catch exceptions of specific type? for instance a compile error is issued if exception 'ExeceptionXXX' thrown by method...
29
by: David Eng | last post by:
In replying to P.J. Plauger (...
2
by: Steve Terepin | last post by:
I've got a Managed C++ wrapper class that calls some functions that talk to a hardware data acquisition card, via a LIB supplied by the vendor. The calls ultimately go through to a DLL, which is...
7
by: cmay | last post by:
FxCop complains every time I catch System.Exception. I don't see the value in trying to catch every possible exception type (or even figuring out what exceptions can be caught) by a given block...
12
by: Vasco Lohrenscheit | last post by:
Hi, I have a Problem with unmanaged exception. In the debug build it works fine to catch unmanaged c++ exceptions from other dlls with //managed code: try { //the form loads unmanaged dlls...
0
by: Epetruk | last post by:
Hello, I posted this a while back, but I have had no response yet. I have a mixed dll which has to catch standard c++ library exceptions. Now I understand that when any object is thrown as...
2
by: yaron | last post by:
Hi, How do i catch an unmanaged c++ exceptions ? right now i can catch the System.Runtime.InteropServices.SEHException and System.Exception exceptions , but i wan't to catch myException...
4
by: dustin | last post by:
I've been hacking away on this PEP for a while, and there has been some related discussion on python-dev that went into the PEP: ...
24
by: usenet | last post by:
I am unable to catch floating exceptions (e.g. divide by 0 or 0/0) using the standard exceptions defined in stdexcept. What is the recommended way to catch such exceptions? Thanks, Song
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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...
0
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
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,...

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.