Hi all,

I am using ICS with BCB6.  I attempt to use a TWSocket in a thread.  Since 
TWSocket is asynchronous all its action is event-driven.  To make it works in a 
thread its message loop method must be called.  My question is how can I add 
custom messages to the object so that custom message handlers can be called?  I 
tried using the message handler macros in the following manner:


class TSocketThread : public TThread
{
private:
         TWSocket      *m_FClientSocket;
 :
 :
};

        BEGIN_MESSAGE_MAP
            MESSAGE_HANDLER(WM_MSG_INSERTED, TMessage, ProcessScktMessage)
        END_MESSAGE_MAP(TThread)


But the created handler ProcessScktMessage will not be called.  I wonder the 
macros define the custom message to TSocketThread object but not the TWSocket 
object.  Changing the parameter to END_MESSAGE_MAP above from TThread to 
TWSocket results in the following error:

'TWSocket' is not an unambiguous base class of 'TSocketThread'


I found there is a method RegisterMessage in OverbyteIcsWndControl.pas but 
there are no examples for how to use.  Can anyone kindly advise the correct way 
to define custom messages (and handlers) to TWSocket objects created in a 
thread?


Thanks in advance.

Patrick
--
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

Reply via email to