473,378 Members | 1,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Loading a form completely.

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

Nov 17 '05 #1
1 851
> 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?


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
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Susan Bricker | last post by:
Hi. I have a Main form with a subform that has a subform. I have an 'Add Event' button on the Main Form that issues the following instruction: DoCmd.GoToRecord , , acNewRec If the record...
6
by: Curious George | last post by:
I have a page that takes about 10 seconds to load the first time it is run. I would like to first display a little animated gif telling the user that the page is loading. How do I do this with...
2
by: JDR2000 | last post by:
I am creating a form, then displaying it using ShowDialog(). The problem is that thie form is supposed to display itself, and then a sound is played. Unfortunately, the sound always starts up...
5
by: John Richardson | last post by:
I've been bothered for some time about my DataGrid not populating my rows very quickly. I have about 10K rows loading into the grid. I create a datatable dt with 2 columns, an ID and a display. ...
3
by: Holmes | last post by:
Hello Ran into a bit of a problem here and have now exhausted my resources to getting this working What I am trying to do is load and show a simple vb form with a listbox in it Dim...
3
by: Per Dunberg | last post by:
Hi all, I have to develop a "skinned" application and I have a problem with the graphics. When a form is loaded and displayed there's aways a flicker where all the controls are located on the...
2
by: =?Utf-8?B?Z2VvZmZh?= | last post by:
I cannot figure this out and would appreciate any help..... I have a datagrid view that displays the results from a Stored Procedure. it can take awhile to load..... the stored procedure fires...
15
by: pdhb_1 | last post by:
I'm trying to run Apache2.2.6 with php. However, I keep getting a long list of error messages in the log file indicating that includes are failing. For example, "PHP Warning: PHP Startup:...
3
by: suresh_nsnguys | last post by:
Respected sir/madam, right now i am displaying movie (.wmv) file using <embed> and <object> tags inside <div> tag. Everything is working fine. ...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.