Thanks Wilfried/Francois At the moment this is just for a simple test app that talks to a third-party server. My comms class allows the GUI (or any class for that matter) to register an event to be called when a certain data packet is received via the socket. It just so happens in this case that I am popping up a messagebox. It seems to me that I either need to postmessage to an intermediate layer which can then call the registered events letting them know that something of interest has happened, or, pop them into a queue and have something else process them outside of the OnDataAvailable event.
By custom message handler, do you mean use a message map and define a new message type something like WM_USER+100? Does this happen only if messages are pumped whilst in the OnDataAvailable event? Would another thread calling processmessages give the same problems? Thanks. On 26/09/2007, Wilfried Mestdagh <[EMAIL PROTECTED]> wrote: > Hello David, > > Yes, a modal form is pumping messages. If it is really nececary to popup > a form if you have received a certain packet, you have to create / show > the form "outside" the OnDataAvailable event. > > To do it outside just post a message to a custom message handler. Your > custom message handler will execute a while later (so outside the event) > and you can safely display the modal form. If you need example, then > just ask of course :) > > --- > Rgds, Wilfried [TeamICS] > http://www.overbyte.be/eng/overbyte/teamics.html > http://www.mestdagh.biz > > Wednesday, September 26, 2007, 16:19, David Perkins wrote: > > > I now suspect that the data is only being sent once. > > > When I receive a certain packet I pop up a messagebox asking the user > > a question and I suspect it is this that is causing the packet to be > > repeated since it is ultimately being displayed by a call from the > > OnDataAvailable event. > > > How may this be prevented? I cannot disable all messge processing in > > my app whilst it's in the OnDataAvailable event. > > > > On 26/09/2007, Wilfried Mestdagh <[EMAIL PROTECTED]> wrote: > >> Hello David, > >> > >> Eventually you can check with SocketSpy what exacly is sent. > >> > >> --- > >> Rgds, Wilfried [TeamICS] > >> http://www.overbyte.be/eng/overbyte/teamics.html > >> http://www.mestdagh.biz > >> > >> -- > >> 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 > -- 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