Handling unmanaged exceptions in MC++ 
Author Message
 Handling unmanaged exceptions in MC++

At the bottom level we have a native C++ dll. Wrapping this, we have a MC++
assembly. Using this we have a C# assembly. If an unmanaged exception is
thrown from the unmanaged C++ dll, and it isn't caught in the MC++ wrapper
assembly. What does the spec state should happen??

[C# Assem] <>------->[MC++ Assem]<>------>[native C++ dll]

Cheers,

4Space



Mon, 19 Sep 2005 17:07:35 GMT  
 Handling unmanaged exceptions in MC++
Hi,

The exception should be catched by the EE. EE will generate a Managed
Exception correspond the unmanaged exception. For example, the Acess
Violation exception will convert to NullReference exception. If the
exception can not be understanded by EE, a SEHException will be raised.

I hope this helps. If you have any questions, please reply to this post.

Best Regards,

Jun Su
Microsoft Support

---
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

| Newsgroups:
microsoft.public.dotnet.general,microsoft.public.dotnet.languages.vc
| Subject: Handling unmanaged exceptions in MC++
| Date: Thu, 3 Apr 2003 10:07:35 +0100
|
| At the bottom level we have a native C++ dll. Wrapping this, we have a
MC++
| assembly. Using this we have a C# assembly. If an unmanaged exception is
| thrown from the unmanaged C++ dll, and it isn't caught in the MC++ wrapper
| assembly. What does the spec state should happen??
|
| [C# Assem] <>------->[MC++ Assem]<>------>[native C++ dll]
|
| Cheers,
|
| 4Space
|
|
|



Tue, 20 Sep 2005 16:54:46 GMT  
 Handling unmanaged exceptions in MC++
.NET has an exception type called SEHException, if the managed C++ wrapper
deliberately avoids catching exceptions from the unmanaged code then the
SEHException will be passed, and can be caught, by the C# assembly.

Richard

--


Quote:
> At the bottom level we have a native C++ dll. Wrapping this, we have a
MC++
> assembly. Using this we have a C# assembly. If an unmanaged exception is
> thrown from the unmanaged C++ dll, and it isn't caught in the MC++ wrapper
> assembly. What does the spec state should happen??

> [C# Assem] <>------->[MC++ Assem]<>------>[native C++ dll]

> Cheers,

> 4Space



Sun, 25 Sep 2005 03:36:27 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Catching unmanaged exceptions in MC++

2. MC++ wrapper for unmanaged static resource

3. Problems to pass HWND from c# client to unmanaged vc++ class via MC++ warpper

4. Crash In Exception Filter in Structured Exception HAndling

5. Floating Point Exceptions: MFC or Structured Exception Handling?

6. Exceptions : Combining C++ and Structured Exception Handling ?

7. Exception handling - how to know which exceptions are thrown

8. MC could not handle virtual function properly

9. (FILE*) handles and MC++

10. Exception across managed/unmanaged

11. managed C++ wrapper around unmanaged C++ classes: causing StackOverflow exception

12. Exceptions Crossing Managed-Unmanaged Boundaries

 

 
Powered by phpBB® Forum Software