Hi Arno >> So there is still another major bug in your code!
But if you do this to the MailSnd demo, {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} procedure TSmtpTestForm.SmtpClientDisplay(Sender: TObject; Msg: String); begin //Display(Msg); end; So that each line sent is not displayed (very quick send, in other words), you get exactly what I get with my app: "RequestDone Rq=5 Error=10004 Error, stoped All-In-One demo" Maybe this is something particular with our mail server? I don't know. But if you slow things down a little (adding the print into the demo seems to do the same thing as a sleep in my app). Pete > From: arno.garr...@gmx.de > To: twsocket@elists.org > Date: Thu, 27 Aug 2009 13:56:16 +0200 > Subject: Re: [twsocket] RESOLVED:: Problem sending larger attachments > > Pete Williams wrote: > > I still need a handler on OnDisplay that sleeps for 2 milliseconds, > > So there is still another major bug in your code! > Maybe the ICS event handler are not called in the right thread context? > Note that ICS event handler are by default executed in the same thread > the ICS object was previously created in. If you use TThread it is method > Execude that runs in thread context, TThread's contructor runs in the > calling thread. Methods ThreadDetach and ThreadAttach may be used to > attach to and detach from _current thread context. > You could also log current thread ID (GetCurrentThreadID) for debugging > purposes. > > -- > Arno Garrels > > > > but everything is working reliably now. I've put through a ton of > > emails this morning and everything has worked out OK. > > > > I'll make sure my message pump code is OK from here onwards. > > > > Thanks a lot, Pete > > > > > > > >> From: arno.garr...@gmx.de > >> To: twsocket@elists.org > >> Date: Thu, 27 Aug 2009 08:41:12 +0200 > >> Subject: Re: [twsocket] Problem sending larger attachments > >> > >> Pete Williams wrote: > >>> I'll post the code tomorrow, but before then... > >>> > >>> - The RTC component is on a TDataModule, which is created in the > >>> Execute() method of the thread in which it runs. > >>> - The Connect method is called from the same thread as it's > >>> constructor, I'm not mixing threads. > >> > >> You do not check message's HWND member. If your custom > >> message IDs EMAIL_GATEWAY_TICK .. EMAIL_GATEWAY_QUIT are not > >> unique they may conflict with message IDs used by TSmtpCli > >> (or RTC?) internally. > >> > >> while not Terminated do > >> begin > >> if not GetMessage(Msg, 0, 0, 0) then > >> break; > >> if Msg.Hwnd = 0 then // PostThreadMessage() => destination HWND > >> = 0 begin > >> case Msg.Message of > >> EMAIL_GATEWAY_TICK : ; > >> [..] > >> else > >> TranslateMessage(Msg); > >> DispatchMessage(Msg); > >> end; > >> end > >> else begin // Dispatch window messages > >> TranslateMessage(Msg); > >> DispatchMessage(Msg); > >> end; > >> end; > >> > >> -- > >> Arno Garrels > >> -- > >> To unsubscribe or change your settings for TWSocket mailing list > >> please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > >> Visit our website at http://www.overbyte.be > > > > _________________________________________________________________ > > Windows Live Messenger: Happy 10-Year Anniversary—get free winks and > > emoticons. > > http://clk.atdmt.com/UKM/go/157562755/direct/01/ > -- > To unsubscribe or change your settings for TWSocket mailing list > please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket > Visit our website at http://www.overbyte.be _________________________________________________________________ Celebrate a decade of Messenger with free winks, emoticons, display pics, and more. http://clk.atdmt.com/UKM/go/157562755/direct/01/ -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be