Hi Marcelo!

Ok, I didn't realize that that was what it was. Thanks for the
clarification!
I tried it in the example application but I still get the same freeze when
trying to connect after the second time the form is created...

Any other ideas?
To rephrase a solution to the problem: If I use the standard example
applications or if I put the smtp component on the main form of my own
application, everything works fine on all computers since the main form is
not released until the application is closed. It is when the form containing
the smtp-component is created and freed when I want to send an email that I
get the freezing problem the second time it is done.

So why not just put it on the main form? Well I want to have the capability
to send e-mails from many applications so it is convenient to have a
separate "e-mail unit" with an Execute-function that I can call from my
applications. Execute takes care of everything from creating the form that
contains the smtp component and shows the sending status to initiating the
properties of the smtp component with the parameters passed to Execute. It
tries to send the email and returns true if the email was sent.

Once again: All suggestions are appreciated.
Thank You in advance!
Best Regards
Henrik

 

-----Ursprungligt meddelande-----
Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För
Marcelo Grossi
Skickat: den 11 december 2006 17:41
Till: ICS support mailing
Ämne: Re: [twsocket] Freeze when using smtp after recreating itsparentform

Hi,

Procedure Variable is a variable that has scope only for a given procedure. 
Example:

procedure MyForm.ButtonSendMailClick(Sender : TObject);
var
   MySendMailForm : TMySendMailForm; <---------- Procedure Variable, for its

only accessible inside this procedure (ButtonSendMailClick)...
begin
   MySendMailForm := TMySendMailForm.Create(params..);
   etc...........
   .....
end;

Regards,

Marcelo Grossi

>> My final remark was that I normally have the form
>> as a procedure variable as it is not needed to be
>> defined outside the buttonclick event and maybe that
>> also solves your issue.
>
> I don't know if I understand You correctly...
>
> 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

Reply via email to