This message is long but broken into the following parts
* Code that fails <1% of the ime
* Message dump for when the code fails
* System calls when the code works
* System calls when the code fails
* Other information
____CODE THAT FAILS____
Below is a snippet of code that works 99.9% of the time
// bring up the form
FrmGotoForm( PartSetupForm );
// And tell the form which part to setup
EventType event;
event.eType = PART_INDEX; // PART_INDEX = 0x6015
MemMove( event.data.generic.datum, &selection, sizeof(UInt16) );
EvtAddEventToQueue( &event );
When the code fails, the system function MenuHandleEvent appears to think
the posted message is for it, not for the newly opened form.
____MESSAGE DUMP WHEN CODE FAILS____
Under gremlins the message activity is the same whether the code works or
not, with the exception of two additional messages that show up.
// This form is code is always called when Form ID 2600 is active
39888.646 (396319): -> EvtAddEventToQueue: frmCloseEvent ID: 2600
// PartSetupForm = 2700
39888.646 (396319): -> EvtAddEventToQueue: frmLoadEvent ID: 2700
39888.647 (396319): -> EvtAddEventToQueue: frmOpenEvent ID: 2700
// This is the message for telling the form which part to load
39888.648 (396319): -> EvtAddEventToQueue: Application event #24597
39888.650 (396319): <- EvtGetEvent: frmCloseEvent ID: 2600
39888.665 (396319): <- EvtGetEvent: winExitEvent Enter: 0x00000000
Exit: 0x00005020
39888.667 (396319): <- EvtGetEvent: frmLoadEvent ID: 2700
39888.701 (396319): <- EvtGetEvent: winEnterEvent Enter: 0x00005020
Exit: 0x00005020 Enter Form: "Part Setup" Exit Form: "Part Setup"
39888.703 (396319): <- EvtGetEvent: frmOpenEvent ID: 2700
// This appears to be getting retrieved by my main message loop
39889.002 (396319): <- EvtGetEvent: Application event #24597
// When the code fails two extra messages are inserted
39889.004 (396319): -> EvtAddEventToQueue: menuCmdBarOpenEvent
// This message is also read by my main event loop
39889.005 (396319): <- EvtGetEvent: menuCmdBarOpenEvent
____FUNCTION TRACE FOR NORMAL CODE____
The call that seems to be posting this message is MenuHandleEvent. Below
are the system calls when the code works
39889.002 (396319): <- EvtGetEvent: Application event #24597
39889.003 (396319): --- System Call 0xA0A9: SysHandleEvent.
39889.003 (396319): --- System Call 0xA3AE: TsmHandleEvent.
39889.003 (396319): --- System Call 0xA2AB: IntlSelectorError.
39889.003 (396319): --- System Call 0xA1BF: MenuHandleEvent.
// Under normal conditions the next calls I see is
39889.006 (396319): --- System Call 0xA173: FrmGetActiveForm.
39889.006 (396319): --- System Call 0xA173: FrmGetActiveForm.
39889.006 (396319): --- System Call 0xA1A0: FrmDispatchEvent.
____FUNCTION TRACE FOR FAILED CODE____
Below is the system calls when the code fails
39889.002 (396319): <- EvtGetEvent: Application event #24597
39889.003 (396319): --- System Call 0xA0A9: SysHandleEvent.
39889.003 (396319): --- System Call 0xA3AE: TsmHandleEvent.
39889.003 (396319): --- System Call 0xA2AB: IntlSelectorError.
39889.003 (396319): --- System Call 0xA1BF: MenuHandleEvent.
// But this is what I get in this case
39889.003 (396319): --- System Call 0xA027: MemSet.
39889.003 (396319): --- System Call 0xA256: HwrIRQ6Handler.
39889.004 (396319): --- System Call 0xA3C4: TargetCfgRoutines.
39889.004 (396319): --- System Call 0xA11B: SysEventAddToQueue.
39889.004 (396319): -> EvtAddEventToQueue: menuCmdBarOpenEvent
____OTHER INFORMATION___
I can only reproduce this under Gremlins. It takes a long time to get to
the bug (around 9 hours). I believe I have seen the bug on my Palm while
using it, and I believe testers have reported the same bug. But it occurs
so infrequently, I have not managed to find a series of steps to reproduce it.
Does any one know of bugs in MenuHandleEvent, or can you put the menu bar
into some configuration that would remain active while forms are being
switched? If you have any information regarding this bug, please let me know.
Thanks
Oliver King-Smith
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/