Re: problem with screen updates



>When I press the button, my program performs a series of calculations. These
>calculations take a fairly long time, so I would like to display a progress
>bar which updates as my calculations are progressing. How would I perform
>this function?
>
>I have attempted to write a series of "progress commands" to the main window
>however these progress commands do not become visible until my calculation
>is complete. THEN all of them are displayed at once on the screen. How can
>I update my screen in Real-Time while my calculation is being processed?

Marek,

It sounds like your application is an ideal candidate to have the time
consuming operation run in a worker thread, leaving the UI thread to
do updates.

Don't try to do the UI from your worker thread - that quickly gets
messy. Instead post a user defined message to your UI window and have
it perform the display operations.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
.