I just did a quick test:

...
procedure TForm1.FormDestroy(Sender: TObject);
begin
        MessageDlg('bob', mtError, [mbOK], 0);
end;
...

and this doesn't produce the message. However:

...
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
        MessageDlg('bob', mtError, [mbOK], 0);
end;
...

does produce the error. I don't know why, but I would guess that the form
handle or application variable is not valid at this point so it doesn't know
how to get to the screen.

Stacey

> -----Original Message-----
> From: Luke Pascoe [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 24 July 2000 3:33 p.m.
> To: Multiple recipients of list delphi
> Subject: Re: Re:[DUG]: Aaaarrggghhh
> 
> 
> Temp is nil, I can step through it and it does get to the 
> "messagedlg..."
> line, but nothing happens. No dialog window, nothing, it just 
> steps right
> past it and closes.
> 
> --
> 
> Luke Pascoe
> Programming
> Ihug
> [EMAIL PROTECTED]
> 0800 GET IHUG ext.9764
> 
> "Dr. Alex Comfort, author of 'The Joy of Sex' has died, after a
> series of strokes." -- From the Times, 28th March 2000.
> 
> --
> 
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
> Sent: Monday, July 24, 2000 3:24 PM
> Subject: Re:[DUG]: Aaaarrggghhh
> 
> 
> > I take it that you are Returning "Nil" from
> General_bits.ReadConfFile('ljch');
> > if it fails to find/read the file
> > And I also assume you are destroying ("Free") the 
> TStringList Temp before
> > setting it to "nil"...
> >
> > HTH
> >
> > Regards
> > Paul
> >
> > ____________________Reply Separator____________________
> > Subject:  [DUG]:  Aaaarrggghhh
> > Author:   [EMAIL PROTECTED]
> > Date:          24/07/2000 15:06
> >
> >
> >
> >      I must be missing something really simple here.
> >
> >      This is designed to test the ReadConfFile proc I've 
> written - it
> should
> >      bring up a message dialog with the error "file not 
> found" in it, but
> >      nothing
> >      comes up and the form closes as it normally would.
> >
> >      procedure Tmenu.FormDestroy(Sender: TObject);
> >      var
> >        Temp: TStringList;
> >      begin
> >        Temp := TStringList.Create;
> >        Temp := General_bits.ReadConfFile('ljch');
> >        if Temp = Nil then
> >        begin
> >          MessageDlg(General_bits.Last_Error, mtError, [mbok], 0);
> >        end
> >        else begin
> >          Temp.SaveToFile('c:\windows\desktop\blah.txt');
> >        end;
> >      end;
> >
> >      --
> >
> >      Luke Pascoe
> >      Programming
> >
> >      "Dr. Alex Comfort, author of 'The Joy of Sex' has died, after a
> >      series of strokes." -- From the Times, 28th March 2000.
> >
> >      --
> >
> >
> >      
> ---------------------------------------------------------------------
> ------
> >          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
> >
> 
> --------------------------------------------------------------
> -------------
>     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

Reply via email to