----- Original Message -----
From: "Neven MacEwan" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Wednesday, July 02, 2003 10:56 PM
Subject: [DUG]: Form Creation


> Hi
>
> I'm sure someones asked this question before but.....
>
> It seems trad to make the 'application' owner of Dialogs and forms
>
> if form := TForm.Create(Application);
>
> Is this strictly necesary? reason being that if anything fails during the
> forms destructuction, the application wont allow another form of the
> same class and also it results in AV on the exit of the app

Nope, not necessary at all. They're quite happy with nil owners, even, eg.
with TfrmSrchClaim.create(nil) do try
  if showmodal = mrOK then
    // do some stuff with properties of the form
  finally
    free;
  end;

Dunno what would happen if the destructor fails, though. Nothing good, I'm
sure.

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to