Use the message pump which is built in TWSocket. There are several sample
program delivered with ICS which have their own message pump (for console
mode or for threads). Have a look at those.

Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be

----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <twsocket@elists.org>
Sent: Monday, September 04, 2006 3:01 PM
Subject: [twsocket] Handling my own windows messages


> Hello,
> my application creates a new thread by client connection and these threads
communicate by custom Windows messages with others threads.
> Before, with ICS in the Execute() method i had:
>
> //create the message queue
> MSG msg;
> PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
>
>
> PostThreadMessage(ThreadID,WM_NULL,0,0);
> WaitMessage();
>
> //etc.
>
> socket->ProcessMessages(); //The quick message pump
>
> Now, in the Execute() method i think there should be something like this
(extracted from this article http://bcbjournal.com/free_issue/Mar04-01.htm):
>
>
> //create the message queue
> MSG msg;
> PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
>
>
> PostThreadMessage(ThreadID,WM_NULL,0,0);
> WaitMessage();
>
> // the message pump
> while (!Terminated && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
> {
> // break, if asked to quit
> if (msg.message == WM_QUIT)
> {
> Terminate();
> break;
> }
> // for window-specific messages
> DispatchMessage(&msg);
> // for thread-specific messages
> switch (msg.message)
> {
> //message handlers
> }
> }
>
> Is this the correct method with ICS? I must overwrite MessagePump method
or OnMessagePump event?
>
>
> Greetings
> Lorenzo
> -- 
> 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