Jack wrote: > Hello Francois, > > I'm not using a TDataModule but as I mentioned in my other email, > I created an object to own the array of TWSocket objects. > > Now I have a new question that relates to the dependency of the > main form. I'm reusing the sockets. So when a socket is > disconnected, I assign a different IP and connect again. I understand > that I can not do this in the OnSessionClosed event handler (or > that didn't work.) Instead, I need to post a message to the main > form, and reconnect in the windows message handler. This also > introduces a dependency to the main form, and adds and some code > in the main form unit. Is there any other way to defer the call to > the Connect function so that it will happen after the code exits > the OnSessionClosed event handler?
You could use a timer, but why? Posting a custom message in OnSessionClosed is fine. > I know I can create a hidden > window in the owner object but I would avoid doing that if there > is an easier way. Creating a hidden window is very easy. At least in D7 AllocateHWnd and DeallocateHWnd are located in both Classes.pas and forms.pas. Arno Garrels -- 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