Markus Humm wrote:

> Ok, but I think I already obeyed to this. 

The correct sequence was ThreadDetach in context of the
thread that created the data module, later in TThread.Execute:

    PumpMessages until SessionClosed;    

ThreadDetach destroys the hidden window and ThreadAttach creates
a new one. Special care must be taken to not use property "Handle"
while no window handle is allocated since this silently created a
new one ( at least since ICS V6 ).
ICS events are always executed in the context of the thread that 
created the hidden window! 

> Let's see what the dynamic
> creation will bring. 

It works reliable, I use TSmptCli and other ICS components in worker
threads since many years successfully.  

> I suppose I don't need any thread attach/detach
> then when I do it inside execute?

Correct, just create and destroy the object in TThread.Execute, very

Arno Garrels 
To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to