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

Managed exception filter

Hi there,

The .NET Framework developer's guide claims that one can filter
managed exceptions in C++.
http://msdn.microsoft.com/library/de...exceptions.asp

However, I don't see how I get access to the managed exception object.
The unmanaged EXCEPTION_POINTERS* is completely useless since I want
to get to the InnerException property of the System::Exception.

BTW, I don't see that this feature in C++/CLI either. Did I miss it?

Thanks,
Albert
Nov 17 '05 #1
2 1689
szilvaa wrote:
The .NET Framework developer's guide claims that one can filter
managed exceptions in C++.
Unfortunately, that document is wrong. C++ only has support to filter SEH
exceptions with the __try/__except construct. This isn't using the CLR's
exception filter capability (although the CLR's filtering is built on top of
SEH).

I've filed a bug to have this document fixed.
BTW, I don't see that this feature in C++/CLI either. Did I miss it?


We do plan to do this in C++ and support it for all exception types;
however, the Whidbey product already has enough features to keep us very
busy. This is on the list for an upcoming product after Whidbey.

Cheerio!

--
Brandon Bray, Visual C++ Compiler http://blogs.msdn.com/branbray/
Bugs? Suggestions? Feedback? http://msdn.microsoft.com/productfeedback/
Nov 17 '05 #2
Thanks Brandon! I've added a bit of VB.NET code to do the exception
filtering for now. Cross language interop comes to the rescue.

The funny thing is that when you use __except under /clr the generated IL
code comes so close to what VB.NET generates: except for one nasty "pop"
that removes the managed exception from the stack before the filter gets
executed.

Oh well,
Albert

"Brandon Bray [MSFT]" <br******@online.microsoft.com> wrote in message
news:up**************@tk2msftngp13.phx.gbl...
szilvaa wrote:
The .NET Framework developer's guide claims that one can filter
managed exceptions in C++.
Unfortunately, that document is wrong. C++ only has support to filter SEH
exceptions with the __try/__except construct. This isn't using the CLR's
exception filter capability (although the CLR's filtering is built on top

of SEH).

I've filed a bug to have this document fixed.
BTW, I don't see that this feature in C++/CLI either. Did I miss it?


We do plan to do this in C++ and support it for all exception types;
however, the Whidbey product already has enough features to keep us very
busy. This is on the list for an upcoming product after Whidbey.

Cheerio!

--
Brandon Bray, Visual C++ Compiler http://blogs.msdn.com/branbray/
Bugs? Suggestions? Feedback? http://msdn.microsoft.com/productfeedback/

Nov 17 '05 #3

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

Similar topics

4
by: Aaron Queenan | last post by:
When I build a C++ library to .NET using the managed C++ compiler, I get the following error message: Linking... LINK : error LNK2020: unresolved token (0A000005) _CrtDbgReport LINK : error...
12
by: Bret Pehrson | last post by:
Suppose the following: // Unmanaged code class UnmanagedException /* not visible outside of unmanaged code */ { }; void DoSomething() /* visible (exported) to managed code */ { throw new...
4
by: Tim Menninger | last post by:
Just started working on this and have not found any real good resources out there. We have a lot of native C++ Dll code that we use for our app. We want to share the code so that C# ASP.net code...
0
by: Ewart MacLucas | last post by:
generated some WMI managed classes using the downloadable extensions for vs2003 from mircrosoft downloads; wrote some test code to enumerate the physicall processors and it works a treat, but a...
0
by: johnsburg | last post by:
Windows 2003 Server ..Net Studio 2003 Creating a simple Windows Form application from the templates, if I try to run it in debug mode devenv.exe aborts with this info: An unhandled exception...
6
by: Shani Aulakh | last post by:
Hi All, I can't find any good examples of throwing exceptions. I have the following code. I want to include all the possible exceptions i can. Help me out on this. I am just moving away from...
0
by: Sendil kumar | last post by:
Hi All, I have an MFC application which calls a C# dll and uses the C# application. Whn the MFC application is loaded I set the 'SetUNhandledExceptionFilter' to my own filter, so, that if in case...
12
by: Karlo Lozovina | last post by:
I'm not sure if Python can do this, and I can't find it on the web. So, here it goes: try: some_function() except SomeException: some_function2() some_function3() ...
2
by: Bob Altman | last post by:
Hi all, We have a native class modeled after the System::Exception class, and all exceptions that we throw derive from this class. For now this class is quite simple: just Description and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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...
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...
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
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
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...

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.