__try __exception __finally MSVC.NET

Started by
2 comments, last by Arild Fines 18 years, 6 months ago
I was looking up error handling in VS.NET (2002) last night and came across these Microsoft specific error handles __try __exception __finally What are your opinions on them and are they better then try catch() blocks? ~guyaton
~guyaton
Advertisement
It isn't a question of one being better than another. They're used for different things.

try/catch in C++ is used for catching exceptions thrown via "throw".

__try/__except/__finally is for catching stuff like access violations. It works in C as well as in C++.
-Mike
__try __except __finally are the keywords associated with "structured exception handling" aka "SEH". You can learn about the guts of it here: A Crash Course on theDepths of Win32 Structured Exception Handling. You can learn about the differences between SEH and C++ EH here, Windows' SEH and C++ Exception Handling.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
C++ exceptions in Visual C++ are built on top of SEH.
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]

This topic is closed to new replies.

Advertisement