Re: The big Debate on DoEvents
- From: cj <cj@xxxxxxxxxxxxx>
- Date: Thu, 15 Jun 2006 09:08:50 -0400
I've written a couple threading programs but I'm not an expert enough to help on that front. It does seem the logical thing to do.
It might not be good form now that we can program threads but perhaps some old fashioned programming would work too. Have you considered using a counter and only calling doevents on every 10 or 20th time you update the progressbar? You know, increment the counter each time the progress bar is run and if the counter modulus 10 or 20 or whatever you pick = 0 then doevents. Better yet make 10 or 20 into a variable and you can adjust responsiveness vs speed on the fly.
Dave wrote:
Ok All,.
I have a program that receives information from the serial port.
Occasionally this information requires me to raise an event and update
a progressbar telling me how much of the information I have received.
My problem lies there. When i update the progressbar, I need to update
the display.... progressbar.refresh, nice and simple, however, if the
user clicks on the screen at any point whilst receiving information
from the serial port, the whole program appears to lock up.... the
screen goes white until the information has completed receiveing
information on the serial port. I therefore implemented an
Application.doevents() after updating the progressbar. This has slowed
the whole process down completely. The information I receive takes
about 1 minute to receive, however with a DoEvents call it takes twice
as long.... this is not acceptable!
Does anyone have any idea how to speed this up whilst also keeping the
form alive? I can't allow my users to see a (not responding) at the
top of the screen and I can't afford to have the time it takes to
receive anything double!
Please help!
Thanks
Dave
- References:
- The big Debate on DoEvents
- From: Dave
- The big Debate on DoEvents
- Prev by Date: How to Send an SMS
- Next by Date: Re: Inserting Variables in a Document
- Previous by thread: Re: The big Debate on DoEvents
- Next by thread: Transparent Form And Visible Line Drawn.
- Index(es):
Relevant Pages
|