Article View: borland.public.cppbuilder.nativeapi
Article #13750Re: Aborting a Application.
From: Remy Lebeau (TeamB)
Date: Mon, 22 Sep 2003 16:14
Date: Mon, 22 Sep 2003 16:14
21 lines
1988 bytes
1988 bytes
"Salvador Huertas" <shuertasw@ghuertasauto.com> wrote in message news:3f6ed6f5@newsgroups.borland.com... > I'm trying abort a application within the event "OnShow" with the > command "PostQuitMessage(0)", but the applicattion finish correctly > but doing severals flashes that for me are a bit ugly. I Try > use "Application->Terminate()" but the result is the same. Both approaches simply post a WM_QUIT message to the message queue. That message is not processed right away, so any operations that are already pending will be processed first. If you want to abort your application during startup, then OnShow is not the best place for that. Use the constructor instead. Either call Application->Terminate() from there, or simply throw an exception. Throwing an exception from a constructor will abort the constructor, and in the case of auto-created forms such as the MainForm, will prevent the message queue from being entered in the first place. Gambit
Technical Details
Message-ID:
<3f6f1fae$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news-xfer2.atl.newshosting.com!63.218.45.10.MISMATCH!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f6ed6f5@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,4c4ba7a11bcb1313 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-09-22 09:18:15 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f6ed6f5@newsgroups.borland.com> Subject: Re: Aborting a Application. Date: Mon, 22 Sep 2003 09:14:44 -0700 Lines: 23 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: 207.175.226.26 Message-ID: <3f6f1fae$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1064247214 207.175.226.26 (22 Sep 2003 09:13:34 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news-xfer2.atl.newshosting.com!63.218.45.10.MISMATCH!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail