E,
> FormClose doesn't free Form, FormDestroy does.
> But FormDestroy of Form2 won't be called before you set Form2.caption
> unless Application.Processmessage has been called. 'ShowMessage' calls
> Application.ProcessMessages, so it'll raise access violation.
OK. That makes sense. So in theory it is safer to up an
Application.ProcessMessages call in after you close a form that has
CloseAction of caFree??
------------------------------------------------------------------------
--Donovan
Donovan J. Edye [www.edye.wattle.id.au]
Namadgi Systems, Delphi Developer
Web: www.namsys.com.au E-Mail: [EMAIL PROTECTED]
Voice: +61 2 6285-3460 Fax: +61 2 6285-3459
TVisualBasic = Class(None);
------------------------------------------------------------------------
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Edward Huang
> Sent: Wednesday, 10 November 1999 09:44
> To: Multiple recipients of list delphi
> Subject: Re: [DUG]: Freeing forms..... Confusion....
>
>
> At 08:48 10/11/99 +1100, you wrote:
> >P,
> >
> >Given TForm1, TForm2 (TForm1 is the main form and TForm2 is NOT
> >automatically created) with the following code:
> >
> >Instance1:
> >
> >No code in form2 and the following works as expected. Form2 is shown,
> >closed.
> >
> >procedure TForm1.Button1Click(Sender: TObject);
> >begin
> > try
> > Application.CreateForm(TForm2, Form2);
> > Form2.Show;
> > Sleep(2000);
> > Form2.Close;
> > Sleep(2000);
> > //ShowMessage('Hello');
> > Form2.Caption := 'I was never freed';
> > Form2.Show;
> > except
> > on E : Exception do
> > ShowMessage(E.Message);
> > end;
> >end;
>
> FormClose doesn't free Form, FormDestroy does.
> But FormDestroy of Form2 won't be called before you set Form2.caption
> unless Application.Processmessage has been called. 'ShowMessage' calls
> Application.ProcessMessages, so it'll raise access violation.
>
>
> --------------------------------------------------------------
> Edward Tianjun Huang Today Software Limited
> 97 Great South Road
> Email: [EMAIL PROTECTED] (Company) Remuera
> [EMAIL PROTECTED] (Private) Auckland
> --------------------------------------------------------------
>
>
> ------------------------------------------------------------------
> ---------
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz