473,383 Members | 1,855 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,383 software developers and data experts.

Catching standard library exceptions in managed code (2nd post)

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 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 817

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: Wild Wind | last post by:
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...
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
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.