form 'freezes'

  • Thread starter Thread starter Erivis
  • Start date Start date
E

Erivis

Hi all,

During a timeconsuming action I like to present a form with a progressbar,
so the user knows someting is going on.
My problem now is that if an user set focus on the form, the caption bar
says: 'xxx does not respond' and the progressbar freezes. The process
however continues without problems.
This must be something trivial, but I cannot find anything that solves this.
Any suggestions?

tia,

Erik
 
Hi Bjørn,
Thanks for your suggestion.

Erik

Bjørn Brox said:
Erivis skrev:
Classical error: You perform the heavy job the main thread, which means
that the form is blocked until the heavy job is complete.

Move it to another thread which reports the progress back to the main
thread.
 
During a timeconsuming action I like to present a form with a
progressbar, so the user knows someting is going on.
My problem now is that if an user set focus on the form, the caption bar
says: 'xxx does not respond' and the progressbar freezes. The process
however continues without problems.
This must be something trivial, but I cannot find anything that solves
this. Any suggestions?

Just start a new thread to do the work and update the progress bar
via invoke.

Arne
 
Arne
Try and see how many hits Google gives on

you must refer to this:
Q: DoEvents is evil?

A: Glenn (Microsoft) Yielding on the UI thread is a legitimate Windows
programming practice. It always has been. DoEvents makes it easy, because
the situations in which you need to use it are simple

<g>

Erik
 
you must refer to this:
Q: DoEvents is evil?

A: Glenn (Microsoft) Yielding on the UI thread is a legitimate Windows
programming practice. It always has been. DoEvents makes it easy,
because the situations in which you need to use it are simple

<g>

That extract is not the typical opinion on the topic.

Arne
 
Back
Top