On Apr 26, 2007, at 11:49 UTC, Marc (aliacta.com) wrote: > For a simple example of what can go wrong: > > Connect a TCPSocket. > > Make a never-ending loop in the main thread with App.DoEvents. > > Have a button with the code "TCPSocket.Poll" or "App.DoEvents" > > Run, and click the button. I bet that *at least* your socket no > longer works, even though the last time I tested this was with 5.5. > And if you're out of luck you might not even become aware that it is > your socket that no longer works, hence the evil nature of > App.DoEvents.
Agreed. LOTS of things can go wrong if you use App.DoEvents anywhere other than for its intended use (which is creating an event-driven console app). > But I use it nonetheless in my code. Just don't put > it anywhere else than in your main thread like in buttons or other > threads and you should be fine. Buttons events *are* in the main thread. If this is a GUI app, I'm not even sure what you mean by "make a loop in the main thread" except in some event, as events are the only way you have of executing code in the main thread. Best, - Joe -- Joe Strout -- [EMAIL PROTECTED] _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
