473,657 Members | 2,493 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

About SEHException

Hi
As I understand things, when my unmanaged C++ code throws
an exception it is wrapped into a SEHException when it reaches
managed code. Now is there a way from the managed catch clause
to get the original unmanaged exception class that was wrapped
in the SEHException ?

Chris.
Nov 17 '05 #1
3 6000
As I understand things, when my unmanaged C++ code throws
an exception it is wrapped into a SEHException when it reaches
managed code. Now is there a way from the managed catch clause
to get the original unmanaged exception class that was wrapped
in the SEHException ?


You can use the unmanaged exception class in the catch clause
(and use it before the catch clause for SEHException if it is also present).

Regards,
Oleg


Nov 17 '05 #2
Oleg Starodumov wrote:
As I understand things, when my unmanaged C++ code throws
an exception it is wrapped into a SEHException when it reaches
managed code. Now is there a way from the managed catch clause
to get the original unmanaged exception class that was wrapped
in the SEHException ?

You can use the unmanaged exception class in the catch clause
(and use it before the catch clause for SEHException if it is also present).


Yes, I know that, but what I'd like to do, for example, is catch the
SEHException from C# code and call some managed C++ conversion function
I would have written, extracting useful information from my internal
exception class. I don't want to put a C++ try / catch around each call
to my unmanaged C++ functions, catching my unmanaged C++ exception class
and throwing my own managed wrapper exception class (SEHException would
be of no use then).

Chris.
Nov 17 '05 #3
Yes, I know that, but what I'd like to do, for example, is catch the
SEHException from C# code and call some managed C++ conversion function
I would have written, extracting useful information from my internal
exception class. I don't want to put a C++ try / catch around each call
to my unmanaged C++ functions, catching my unmanaged C++ exception class
and throwing my own managed wrapper exception class (SEHException would
be of no use then).


AFAIK this information is not directly exposed (since it is actually
specific to CRT library and not documented).

Regards,
Oleg


Nov 17 '05 #4

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

Similar topics

4
9068
by: MJB | last post by:
I never get the above exception in Windows 2k. It only happens in Windows XP, which is the first oddity. My application is multi-threaded and I use the webbrowser control and media player. The exception normally occurs when I open the browser control or media control, but sometimes it just occurs randomly. I was thinking first that it was some sort of build difference with the COM interop components, but I re-referenced and rebuilt...
0
613
by: Carsten | last post by:
Hi, I have a problem with instantiating a Web service. When the constructor for the proxy is called a SEHException is thrown. The call stack is shown below: System.Runtime.InteropServices.SEHException: External component has thrown an exception.
0
2673
by: Robert Mayr | last post by:
Hello, i know that this is a bug of the .net framework, when you activate the VisualStyles, so i deactivate this features. But i get sometimes this exception when i call <Form>.ShowDialog (not allways from the same form) This also occures sometimes in the forms initialization when the form tries to load an object (image or icon) from the ressources. Message: System.Runtime.InteropServices.SEHException: Eine externe
0
1620
by: Droopy | last post by:
Hi, I am working for a few month on a C# project (mixed dll for calling C++ legacy code with a C# wrapper). Since this morning, I can't start my application anymore ! I got a System.Runtime.InteropServices.SEHException when the app load (in my main Form, in InitializeComponent (), creating a TextBox). Here below, you will find the output from VS.
0
1548
by: Ken Durden | last post by:
I'm getting the following exception coming out of a block of unmanaged C++ code. Thread executed for 1.03 sec and died with the following exception: External component has thrown an exception. ==== Primary Call Stack ==== at ?Setup@EdgeTopImageProcessor@Edge@InspectionAlgorithm@August@@$$FQAEXHHHHW4eBayerFormatType@BayerImage@234@ABUEdgeTopParam@1234@PAVErrorTraveler@Unmanaged@Infrastructure@4@@Z(EdgeTopImageProcessor* , Int32 , Int32...
1
2143
by: Micke | last post by:
Hi all! I have a problem and don't know what to do. I have written an application in asp.net using C# as my language. The application calls an external dll file. This is written i VS.NET C++. I have on my machine for development placed the resulting dll-file in the bin folder of my web application and it all works well. Here my OS is WinXp Pro. But when I try to deploy my solution to a Win 2003 Server (Standard Edition). I can't call the...
4
1550
by: - R | last post by:
Hello all. I'm new to .Net so please help me out. I have a application with several "Threads" running to observe various things. From time to time each thread need to add an log entry, which is displayed on a form (a datagrid on a form) there is no database, but i created a dataset using the designer. One Entity/Table is called Log and contains the log-entries.
0
2314
by: =?Utf-8?B?VGhvbWFzIFR1dGtv?= | last post by:
An ASP.NET web project has recently began crashing WebDev.WebServer.exe with a System.Runtime.InteropServices.SEHException. The EventLog for the crash looks like this: Application ID: WebDev.WebServer.EXE Process ID: 1552 Exception: System.Runtime.InteropServices.SEHException
0
2440
by: THEDuke141 | last post by:
Hi guys, I've lately been plagued with a SEHException while trying to debug VB.Net applications. I'm not exactly sure when the problem started to appear but it literally just appeared out of nowhere as debugging was working fine one day and then this error the next. I've read plenty of posts relating to this error but they all seem outdated and they mostly seem to point to Application.EnableVisualStyles() which i do not use. Also note...
0
8421
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8325
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8844
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8742
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6177
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
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 we have to send another system
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.