The MP3car.com Store The MP3car.com Store    

Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development > Front Ends > Road Runner > RR Bug Tracker

Reply
 
LinkBack Thread Tools Display Modes
Old 06-14-2005, 10:46 PM   #1
FLAC
 
Join Date: Sep 2004
Posts: 1,556
Use of DoEvents leads to lots of different and serious usability bugs.

I finally tracked down the cause of a bug I complained about some time ago. Because the code currently liberally uses DoEvents throughout to keep the UI responsive, it introduces an entirely new set of bugs that are worse.

Here's an easy repro:
1. Misconfigure the web browser so it has the IE exe location but is set to try and find firefox.
2. Go to the web skin.
3. Hit the back button 3 times.

Expect:
First click is reacted to.

Actual:
Since the skin is busy waiting for the web browser to load (the newly extended 15 second wait), the click doesn't get acted upon but the button does highlight and the action is queued up. Now since nothing happened, the user clicks the button again. Nothing happens again. So they click it again. And so on. Finally RR gives up on waiting for the web browser to load and processes the large number of 'EXIT' actions on the queue and RR inexplicably exits entirely as each command barrels up the call stack until the app itself exits.

This is somewhat manufactured except that IE does take some time to start and for RR to see it so it is possible to hit this. And I was hitting this from time to time when I first started using RR and was having RR exit on my for no obvious reason.

I keep finding bugs that are caused by the use of DoEvents. In most of the cases, the use of DoEvents is almost entirely overkill and they can simply be removed with no noticable effect on the program. In other cases, they actually introduce worse bugs like this one. Another example of another bug I fixed by removing the DoEvents was in the skin show code - now my version of RR never shows stale data in lists/labels etc when you go to a new skin that then immediately updates to the correct data. I just see the correct data straight off. All I did was remove the repaint & DoEvents calls in the middle of the skin load.

I understand the desire to keep the UI responsive but there are better ways to do it targeting those cases where the app really is busy for a while. E.g. changing the app embedding code to use the timer to catch the window name and force it to the right size. In the meantime, the skin can be left to respond immediately to clicks rather than pretending to respond and letting the user shoot themselves in the foot.

Re-entrant UI only ever leads to subtle and frequently very nasty bugs even when the reentrancy isn't intended (e.g. a side effect of using COM). Using DoEvents is asking for trouble and has no real benefit since at best it hides a design flaw in the program.
__________________
Progress: 80% - Permanent install left.
Motion LS800 Tablet PC and dock.
Vista, Bu-535 GPS, RoadRunner, MPT2006.
Arathranar is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off


All times are GMT -5. The time now is 11:41 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics