Hi Frans! 

Yes, each time You press the button the form is created and then released.
You also get the same problem if You set Action to caFree in the OnClose of
the created form.

  procedure TForm2.Button1Click(Sender: TObject);
  begin
    SmtpTestForm := TSmtpTestForm.Create(Application);
    SmtpTestForm.ShowModal;
  end;

  procedure TSmtpTestForm.FormClose(Sender: TObject; var Action:
TCloseAction);
  begin
    Action := caFree;
  end;

Also read my response to Arno.
I'm very thankful for all the help I can get!
// Henrik

-----Ursprungligt meddelande-----
Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För
Frans van Daalen
Skickat: den 11 december 2006 10:39
Till: ICS support mailing
Ämne: Re: [twsocket] Freeze when using smtp after recreating its parentform


----- Original Message -----
From: "Henrik" <[EMAIL PROTECTED]>
To: <twsocket@elists.org>
Sent: Monday, December 11, 2006 9:59 AM
Subject: [twsocket] Freeze when using smtp after recreating its parent form


> Hi!
>
> I have probably misunderstood something because I get the same behavior
> described below no matter which of the components SmtpCli, SyncSmtpCli and
> HtmlSmtpCli I use.
>
> The problem has to do with freeing the smtp-components parent form. You 
> can
> easily duplicate the behavior with one of the standard demo applications:
> * Open Your favorite demo of  MailSnd, MimeTst or MailHtml. (I proceed 
> with
> MailSnd-demo below.)
> * Add a new form with a button to the project. Write the following in the
> buttons OnClick method:
>      procedure TForm2.Button1Click(Sender: TObject);
>      begin
>          SmtpTestForm := TSmtpTestForm.Create(Application);
>          try
>              SmtpTestForm.ShowModal;
>          finally
>              SmtpTestForm.Release;
>          end;
>      end;

 When entering the second time is the form already released then?

I normally just call .free never used .released. I also make the 
SmtpTestForm a procedure based variable in these kind of constructions. 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to