Link to home
Start Free TrialLog in
Avatar of askldjd
askldjd

asked on

MFC Start Up Dialog that display loading information

Hi.

I am kind of new to MFC, currently working on a Diary program.
The current implementation is that I put the loading function in OnInitialUpdate of the CRichEditView class. The problem is that the Diary application won't display until all the entries are loaded in memory, and this is a big problem for me. As entries gets above 200,000 char, there is a lag.

Right now, there is two solution that I need help on, either is fine.
1. I want to create some sort of start up dialog that displays loading information. Then closes itself once everything is done, and go straight to the Application.
Problem: How do to make something like that?

or

2. Display the application first, then load the function, and uses the CProgressbar to display the information.
Problem: I got the progressbar working, but I don't know how to call the load function automatically after the application is displayed. OninitialUdpate doesn't work, what should I do?

Thank you very much
The source code is at http://www.rpi.edu/~ningc

Alan
ASKER CERTIFIED SOLUTION
Avatar of luvjd
luvjd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of luvjd
luvjd

Avatar of AndyAinscow
I would do the following.
Start your app.
In the OnInitialUpdate of the view start a timer (eg. SetTimer(1, 10, NULL)) with a small interval and disbale the main window (AfxGetMainWnd()->EnableWindow(false))
In the timer handler in your view
KillTimer(1);
Start loading your diary
When loading is finished / when error ocurrs then free up the main window (AfxGetMainWnd()->EnableWindow(true)).