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