Re: does FormClose have some special magic?



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
.



Relevant Pages

  • Re: dialog form size different in IDE or exe
    ... displays exactly the same size that it has been sized to display in the ... But when compiled and run as an EXE the form stretches precisely the ... Unless it's a bug with the video driver on the laptop, ... It looks fine when run in the IDE. ...
    (microsoft.public.vb.general.discussion)
  • Re: App with forms as tabs
    ... convert an application I already coded over to this 'Visual Studio IDE' ... This app has 50 or so already coded forms - I really don't ... Isn't there any way to display an already-created form in a tab? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Slow compile and launch times
    ... project and wanting to display another form than the displayed one... ... found that compile time are even worser.... ... > outside of the IDE. ... > applications outside of the IDE (without debugger support of course) just ...
    (borland.public.delphi.non-technical)
  • Re: Is a General File Maintenance Routine possible?
    ... Most compilers DO NOT come with such a tool. ... So independent of the IDE he has programs/classes that he can ... invoke to do a textual display of the file. ... , to a DOS window, or even print it out. ...
    (comp.lang.cobol)