Threads, progress bars and PDAs

  • Thread starter Murray Foxcroft
  • Start date
M

Murray Foxcroft

Hi

I have a PDA that will run an application launch program. This little
program will check a web service to see if an update is available and if it
is, will download it.

Now, this works on the emulator that comes with VS.Net 2003 (Pocket PC 2003
Emulator), well mostly! It uses a progress bar (which works in a dissociated
manner with a System.Windows.Forms.Timer). The timer fires once a second and
updates the progress bar by one. This happens while the web service runs
asynchonously to determine update status, etc. When the web service returns,
it updates the progress bar to full, i.e. set the value to the maximum.
After that, it uses the same progress bar to show it's progress in
downloading an update. This works - mostly - in the emulator. I say mostly
as sometimes it seems to need a hard-reset before it will run again. But
this isn't the issue.

The issue is: When it is running on the actual device, the progress bar
locks up after a few seconds, and the whole app seems to hang. I cannot
replicate this situation in the emulator. It is possible that there is a
timing issue, or threading issue with my main UI thread and the progress
bar?

Many thanks
Jase
 
C

Chris Tacke, eMVP

It's becasue you should *never* affect the UI thread from a worker thread
directly. This is also the case in the full framework, so it's a bit
surprising it's worked there. Google Control.Invoke to see how it should be
done.

-Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top