On Mon, Jan 07, 2002 at 10:15:51AM -0800, Dave Carrigan wrote:
> However, if I set the event's data to the value 262, the program fails.
> It appears that something inside PalmOS wants to handle the event,
> because the event gets eaten, and a spurious menuCmdBarOpenEvent is
> generated. If I use any other value in the data then my form sees the
> event and pops up the alert. 

(Did you really test all 65535 other values?  :-))

If you instrument your sample program, you will see that it is
MenuHandleEvent that is eating the event.  If you grep the SDK headers
for 262 (= 0x0106), you'll see that 262 is commandChr.  If you compare
the released 3.5 and 4.0 ROM source code, you'll see that a 3.5 bug in
the handling of commandChr in the menu command bar processing part of
MenuHandleEvent was fixed before 4.0.

By looking at the source code you can convince yourself that this bug
occurs on 3.5.x when MenuHandleEvent is given any kind of event which
has datum[0] set to 262, and that any other value of datum[0] is safe.

Now you can work around the bug in various ways such as:

* Sidestepping MenuHandleEvent when the event has your custom event
  type;

* Not using the number 262 in your custom events;

* Not using datum[0] in your custom events.

(Of course you have to hope that none of the system's events happen to
have 262 here too.  Maybe this has implications for control ID choice
too.)

Ain't Palm OS grand.  :-)

    John

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to