> The DLL has a data module which has one single TWSocket for all incomming data > and for each outgoing connection a TWSocket is created dynamically. The > instance of this > socket is stored in a TObjectList together with other relevant information. > When the first connection is opened a seperate thread within the DLL is > created for handling > of the windows messages (needed by TWSocket and other components as well).
You must use TWSocket.ThreadAttach to bind a TWSocket to a thread different from the one which has created the socket. You must call ThreadDetach before terminating the thread of freeing the component. It may be easier to create and free the component within the thread's context, that is within thread's Execute method. When using a DLL, pay attention to memory allocation/deallocation (Use ShareMem). Also pay attention to the fact that whan not using runtime packages, a component of the same class in the main program and in the DLL is in fact two different components ! (Is and As operators do not work as expected at first glance, casting is very dangerous). -- 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 -- 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