Re: DoEvents() "Hangs"
- From: "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
- Date: Thu, 3 Aug 2006 21:00:24 -0700
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
.
- References:
- DoEvents() "Hangs"
- From: cedmunds
- Re: DoEvents() "Hangs"
- From: Greg Young
- Re: DoEvents() "Hangs"
- From: cedmunds
- Re: DoEvents() "Hangs"
- From: wfairl
- Re: DoEvents() "Hangs"
- From: cedmunds
- Re: DoEvents() "Hangs"
- From: wfairl
- Re: DoEvents() "Hangs"
- From: Greg Young
- Re: DoEvents() "Hangs"
- From: cedmunds
- Re: DoEvents() "Hangs"
- From: Doug Forster
- DoEvents() "Hangs"
- Prev by Date: Re: Generics SortedList and DataSource
- Next by Date: Re: Multiple language resource files inside single assembly
- Previous by thread: Re: DoEvents() "Hangs"
- Next by thread: Re: DoEvents() "Hangs"
- Index(es):
Relevant Pages
|