Re: How to display messages to the user during long processes!!
On Sep 24, 7:42 am, Joseph M. Newcomer <newco...@flounder.com> wrote:
That's why I hook the node-builder event. It allows me to show actual =
progress. In my
PowerPoint indexer I am able to determine the total number of slides and =
that makes it
pretty easy, but at each #include I add a new progress bar and let it run=
.. This is much
better than having a single progress bar whose contents you can never int=
erpret, as it
makes N passes but you have no idea what 'progress' it is really showing.
I added the XML progress bar even though it takes under a minute to read =
and parse the
file because the customer really wanted a visble progress bar for any ope=
ration that took
longer than a few seconds (5 seconds was the nominal acceptable delay tim=
e without a
progress bar). In the library I use, the node-hook is called each time=
a node is started,
and when you call the reader, you give it an LPVOID userData type of para=
meter. So I just
packaged the CFile* into the structure I passed in, which let me get the =
file position
each time a node is built. A small data file can have perhaps 10,000 n=
odes, a large one
perhaps 250,000. In practice, we seemed to hover around 25,000-40,000 =
nodes, and this
exceeded the 5-second limit.
=
joe
On Tue, 23 Sep 2008 14:30:11 -0700, "Tom Serface" <tom.nos...@camaswood.c=
om> wrote:
I think an approx. progress bar is better than none, but one that jumps =
from
0 to 100 is pretty useless. The thing to strive for is periodic feedb=
ack if
the process is going to take a long time. I'm not sure why this is th=
e case
with an XML file unless it is huge. I can parse a 500K line XML file =
before
the progress bar even displays so I haven't found it useful to show that
kind of feedback.
Tom
"Joseph M. Newcomer" <newco...@flounder.com> wrote in message
news:rfhid494n5j1nf5rjsktvddtr8e515ljak@4ax.com...
I have an article inwww.codeguru.com(linked to from my Web site) on how
to put progress
controls on a status bar.
In my PowerPoint Indexer, I have a dialog that does nested progress ba=
rs
as various
#includes are processed (I allow the user to start with one presentati=
on
and pull in a
second one for a composite index). The whole point was to allow for=
early
termination.
Many parsing libraries have hooks for various events; the XML librarie=
s I
use all do.
That's where I just ask the current file position of the input file. =
It
isn't quite
dead-on because it represents where the file pointer is, not where the
internal buffers
are, but it is a good enough approximation for a progress bar.
joe
Joseph M. Newcomer [MVP]
email: newco...@flounder.com
Web:http://www.flounder.com
MVP Tips:http://www.flounder.com/mvp_tips.htm- Hide quoted text -
- Show quoted text -
Thnx all for your responses.But i feel it is a bit complicated.My
solution is
what i have to do is that for connecting to the device and parsing
the .xml file it will take 1-2 minutes.During that time i need to
show"please wait loading in progress" message.
so for that
//Logic is simple i am starting the message "please wait loading in
progress"
theApp.m_dlgMain->PostMessage(WM_MSG,1,0);
/* code for connecting to the device and parsing the .xml file which
will take 1-2 min*/
//Stop the message
theApp.m_dlgMain->PostMessage(WM_MSG,0,0);
ON_MESSAGE(WM_MSG,Dispmesg);
LRESULT CDlgMain::Dispmesg(WPARAM wParam, LPARAM lParam)
{
if(wParam==1)
{
Message "please wait loading in progress" should
start
I do not know how to start a message just saying
the above with no controls-->need help here
}
else
{
Message "please wait loading in progress" should
stop
I do not know how to stop a message just saying
the above with no controls-->need help here
}
return TRUE;
}
Please need help on this...
Thanks in advance,
RAGHU