Re: DoEvents() "Hangs"



Doug Forster wrote:
Hi,

We believe that will the current solution is ugly it should still
work. We remain puzzled that the DoEvents will work but then
suddenly stop responding.

Well I hope you take some of the very good advice you have been given
so far, but I must admit I do agree with your statement here. Hangs
like this can be caused by deadlocks though you haven't shown enough
code to tell us much there. I also wonder if your thread code might
be poking its nose into UI components in a non thread safe way?

....which is to say, in any way at all.

My first thought on reading the initial post in this thread was that the
background thread is trying to update the UI without going through
Control.{Begin}Invoke - that's a sure recipe for UI hangs like this. But
since he's apparaently using .NET 2.0, I doubt that's the case, since the
2.0 Winforms classes will throw an exception if you touch them from the
wrong thread.

I agree completely with the other advice in this thread: get rid of the
sleep/doEvents loop and put up a modal form, or just disable the main form
until a callback (or event) from the worker thread indicates that it's time
to move on to the next step.

-cd




.



Relevant Pages

  • Re: Word 2003 hangs on opening
    ... hangs. ... If I follow the main advice of deleting the normal.dot template then ...
    (microsoft.public.word.application.errors)
  • Word 2003 hangs on opening
    ... hangs. ... If I follow the main advice of deleting the normal.dot template then ...
    (microsoft.public.word.application.errors)
  • what How malicious hackers abuse the Internet
    ... hangs out with birds is real strange. ... >Heading her advice could lead to a life of spontaneous ...
    (microsoft.public.security)
  • Re: forgot password on notebook pad
    ... > CASSANDRA JAMES wrote: ... > Someone else who hangs around here had some good advice and links on the ... Given how politically correct many try to be nowadays, ...
    (microsoft.public.security)
  • Re: DoEvents() "Hangs"
    ... We remain puzzled that the DoEvents will work but then suddenly stop ... responding. ... Well I hope you take some of the very good advice you have been given so ... I also wonder if your thread code might be poking its nose into ...
    (microsoft.public.dotnet.languages.csharp)