Article View: borland.public.cppbuilder.nativeapi
Article #6736Re: custom VCL exceptions, how?
From: Francisco M. Marzoa
Date: Mon, 18 Apr 2005 16:19
Date: Mon, 18 Apr 2005 16:19
55 lines
2555 bytes
2555 bytes
I think I've got it, thanks a lot again, Jonathan.
Jonathan Benedicto wrote:
> "Francisco M. Marzoa" <fmmarzoa@softronica.org> wrote in message
> news:4263da98@newsgroups.borland.com...
>
>>It compiles fine, thanks a million. BTW, now it says that a return
>>statement that I've just after throw the extension is an
>>"Unreachable code". Do you know why?
>
>
> You can remove that return. I hope I can explain this.
>
> VCL apps are built like this : (much-simplified)
>
> WinMain
> {
> try
> {
> YourApplication
> {
> // if your code throws an exception, that does not have
> // a try / catch block around it somewhere, then the
> // exception gets caught back here in WinMain.
> }
> }
> catch()
> {
> HandleException
> }
> }
>
> So, you don't need that return because your methods will just stop
> executing, and the app will "hop" to the "nearest" try / catch block.
> By nearest, I mean like this:
>
> try // Then this one.
> {
> try // This is the nearest
> {
> throw Exception("...");
> }
> }
>
> try // Not this one.
> {
> OtherCode();
> }
>
> I've tried to explain it clearly, but I hope that you can follow it.
>
> Jonathan
>
>
>
Technical Details
Message-ID:
<4263ddf5@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!news.glorb.com!tudelft.nl!feeder2.cambrium.nl!feed.tweaknews.nl!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<4263d57c@newsgroups.borland.com> <4263d6dc@newsgroups.borland.com> <4263da98@newsgroups.borland.com> <4263dd94$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,b4c3995c44850950 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Mon, 18 Apr 2005 18:19:02 +0200 From: "Francisco M. Marzoa" <fmmarzoa@softronica.org> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: custom VCL exceptions, how? References: <4263d57c@newsgroups.borland.com> <4263d6dc@newsgroups.borland.com> <4263da98@newsgroups.borland.com> <4263dd94$1@newsgroups.borland.com> In-Reply-To: <4263dd94$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 213.4.20.55 Message-ID: <4263ddf5@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1113841141 213.4.20.55 (18 Apr 2005 09:19:01 -0800) Lines: 56 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news3.google.com!news.glorb.com!tudelft.nl!feeder2.cambrium.nl!feed.tweaknews.nl!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail