On Jan 29, 2008 1:14 AM, Jonathan Carse <[EMAIL PROTECTED]> wrote: > I thought I won't have to deal with plumbing issues if I chose to be a > software engineer... :)
:) actually - your issue is not a plumbing issue, its more a design flaw. > I am performing a long operation in one of my functions, which takes about > 30 seconds. see; thats your problem. palm is not a multi-threaded operating system so what happens is your routine takes over the device and when the user taps on keys or pens, the interrupts for those input devices are called which is eventually overflowing your buffer. FIX #1: the simple fix is to keep what you have; and, ensure the event queue does not get full. instead of calling EvtFlushXXXQueue() after your process; do it within in; after every iteration. you need to prevent the event queue from getting full. the problem with this approach is that there may be enqueued events which you are going to lose/zap by calling flush() FIX #2: turn your for-loop into a series of nilEvent processing. ie: make the processing event driven. when the process is running; simply ignore all key and pen events - your busy :) you can also do some form of animation/user interfaction every time a nilEvent comes; like, show a percentage bar etc.. just locking up the device is not acceptable; and, i'm not surprised the users clicking around like crazy - your app locks up :) (in their eyes) > // Iterate through all the databases (while there were no errors) > for(u_wCurrentDB = 0; u_wCurrentDB < TOTAL_DATABASES && returnValue == > PERFORM_BACKUP_SUCCESS; u_wCurrentDB++) > { > // Long operation (backing up to memory card) // Flush all user input out of the queues EvtFlushKeyQueue(); EvtFlushPenQueue(); > } instead.. if your looking for the lazy fix. i mean lazy when i say it; as you should really restructure your code. lockups are expected on windows mobile :) not on palm. -- // Aaron Ardiri -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/