Hi Arno and thank You for the reply!

I use V2.32 of SmtpProt.pas (the one You get when clicking "Download the
latest ICS-V5 Distribution" on overbyte.be) and Delphi7.

Trying to solve this mystery I have now discovered two things:
* Since You did not experience any problem I decided to test the example
application on another computer by copying the exe-file. Here the second
time I show the SmtpTestForm and presses the "All-in-one" button everything
works ok and the mail is being sent as expected!!!
Do You have any ideas on what can be the difference between these computers
that leads to the freeze problem on just one of them? (both has Win XP SP2
and the latest Windows update patches)

* I don't know if this gives any clues but a workaround on the computer
where the problems appear is to either not destroy the form OR create a
dummy smtpCli component like in the code below!

    procedure TForm2.Button1Click(Sender: TObject);
    var dummySmtpCli : TSmtpCli;
        alreadyCreated: Boolean;
        i: integer;
    begin
      SmtpTestForm := TSmtpTestForm.Create(Application);

    // Workaround that prevents freezing on some computers
      alreadyCreated := false;
      if Application.ComponentCount > 0 then
      begin
        for i := 0 to Application.ComponentCount-1 do
        begin
          if Application.Components[i].Name = 'DummySmtpClient' then
          begin
            alreadyCreated := true;
            BREAK;
          end;
        end;
      end;
      if not(alreadyCreated) then
      begin
        dummySmtpCli := TSmtpCli.Create(Application);
        dummySmtpCli.Name := 'DummySmtpClient';
      end;

      try
        SmtpTestForm.ShowModal;
      finally
        SmtpTestForm.Release;
      end;
    end;
    

Any further thoughts on the matter is greatly appreciated!
// Henrik

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

Hello Henrik,

Just tested  with latest V5 beta, but works great?

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


Henrik wrote:
> 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;
> * Click on the menu: "Project" - "Options", and remove the 
> SmtpTestFrom from the "Auto-createForms" list.
> * Run the application and click the button. SmtpTestForm opens and You 
> can send lots of e-mails.
> * Close SmtpTestForm and press the button again. Try to send yet 
> another email and You get stuck!
> 
> I guess I'm doing something fundamentally wrong?! I have narrowed it 
> down to that everything works as expected if I don't release the form.
> (I get the same error when setting Action to caFree in
> SmtpTestFrom.OnClose.)
> 
> Is it not a good idea to free a manually created form?
> 
> Best Regards
> Henrik
--
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