Hi Everyone.
I have a pretty easy question but I can't solve it.
My code.
myLoadingForm mLF = new myLoadingForm();
mLF->Show();
/* Process Data */
mLF->Hide();
My problem is that I want to show this form and load it completely before i
start to process my data. This form show a text what I'm doing atm and also a
progress bar that i update during my processing and an animated gif so that
the user could see that the application is working.
But the animation and the text telling the user what is going on never loads
except when my process is done but then its already to late. How do I load
the form and all it's object before I start to process my data?
Best regards
Daniel Persson
> My problem is that I want to show this form and load it completely before i
> start to process my data. This form show a text what I'm doing atm and also a
[quoted text clipped - 4 lines]
> except when my process is done but then its already to late. How do I load
> the form and all it's object before I start to process my data?
You have to use threads, or call into Application->DoEvents
periodically. That's because while you are processing your data, the GUI
is not responding. Try something like this:
while(your_loop)
{
do_fraction_of_your_processing();
Application->DoEvents();
}
See http://tinyurl.com/5zul4 for a complete example.
I also recommend that you consider putting your processing into a
thread. It has better performance, as DoEvents() has quite a bit of
overhead, and it's hard to guess how frequently it should be called.
Tom