Re: does FormClose have some special magic?
- From: Rob Kennedy <me3@xxxxxxxxxxx>
- Date: Fri, 02 Sep 2005 11:18:32 -0500
Ante Smolcic wrote:
All I can say is that suggesting mangling with the DPR to someone not that expirienced is not a very good idea.
I see no reason to treat anyone with kid gloves.
Besides, although Corinna is new to Delphi, she seems to have experience with other languages. The idea of writing code is not a new one.
It can be perfectly achieved without the DPR code changes.
The changes to the DPR file are the most direct way of solving the problem. I consider that way more perfect.
With my way, the main program form doesn't have to worry about the password dialog at all. It can simply assume that if it's running at all, then the user has already logged in. Otherwise, you wind up with code in the main form to delay initialization until after it's had a chance to display and process the password dialog. You also end up creating and loading a form tha tmight never need to be displayed.
We see problems here all the time with people trying to cancel the initialization of their program from within the OnCreate event. That's a difficult place to back out of in part because exceptions can't escape that event, so you can't just call Abort. People also call Application.Terminate and then wind up continuing to wait since the application-termination signal isn't checked until you call Application.Run.
There are certain patterns of text that the IDE expects to find in the DPR file, and as long as you don't mess with them, you're fine:
Maintain one use of Application.CreateForm. Don't worry about indentation of CreateForm lines since the IDE may rewrite thsoe lines when you change your project's form settings. Do not use "Application.Title" except as the left-hand side of an assignment statement. Avoid conditional-compilation directives within IDE-managed portions of the DPR, which include the "uses" clause and the main begin-end block. Conditional compilation is fine in other parts, such as within function or class declarations.
-- Rob .
- Follow-Ups:
- Re: does FormClose have some special magic?
- From: Ante Smolcic
- Re: does FormClose have some special magic?
- References:
- does FormClose have some special magic?
- From: swansnow
- Re: does FormClose have some special magic?
- From: Rob Kennedy
- Re: does FormClose have some special magic?
- From: Ante Smolcic
- Re: does FormClose have some special magic?
- From: John P
- Re: does FormClose have some special magic?
- From: Ante Smolcic
- does FormClose have some special magic?
- Prev by Date: Re: does FormClose have some special magic?
- Next by Date: Re: Implementation question
- Previous by thread: Re: does FormClose have some special magic?
- Next by thread: Re: does FormClose have some special magic?
- Index(es):
Relevant Pages
|
|