Article View: borland.public.cppbuilder.nativeapi
Article #14983Re: Exception handling
From: Yahia El-Qasem
Date: Thu, 24 Jul 2003 17:29
Date: Thu, 24 Jul 2003 17:29
30 lines
2381 bytes
2381 bytes
> try and catch are the standard C++ method of managing exceptions. > > __try, __except, and __finally are related to the operating system > exceptions. > > The two types of exceptions, and they way they are handled, are > actually distinct. > > As OS exceptions are usually something that can be avoided by > good coding, it is probably better to design your software so > they don't occur in the first place. If you feel you really must > catch them, the recommended approach is to catch OS exceptions > (using __except) and have the handler throw an appropriate C++ > exception. You are absolutely right - I try usually to avoid such things by better design / coding... The problem occurs usually with third party components / OLE Automation Servers I have to use... They do whatever they do ok but sometime throw OS exceptions - I need to catch these... Otherwise my whole app behaves strange ( if I don't catch them )... Even when using __except etc. with some exceptions it seems impossible to catch them - esp. when they occur inside OLE Automation servers I use... And this really makes my app reacting really strange when this happens... Is there any way making sure that really all exceptions get caught ? Yahia
Technical Details
Message-ID:
<3f2017c2@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!pln-w!extra.newsguy.com!lotsanews.com!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f1ee3c0@newsgroups.borland.com> <3f1fcbe4@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,9958034f094baec7 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-24 10:40:27 PST Reply-To: "Yahia El-Qasem" <Yahia.El-Qasemno.spam@mgh.metro-ag.de> From: "Yahia El-Qasem" <Yahia.El-Qasem@mgh.metro-ag.de> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f1ee3c0@newsgroups.borland.com> <3f1fcbe4@newsgroups.borland.com> Subject: Re: Exception handling Date: Thu, 24 Jul 2003 19:29:06 +0200 Lines: 32 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 80.133.54.4 Message-ID: <3f2017c2@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1059067842 80.133.54.4 (24 Jul 2003 10:30:42 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!pln-w!extra.newsguy.com!lotsanews.com!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail