I must be doing something wrong, but I sure don't get it....
The following events cause the ROM to crash... But why!

Here are the offending lines....


EventType newEvent;
EventType *event = &newEvent;

EvtGetEvent(event, 20);


Here is the sequence of events...

My program is running...
An alarm from my program is triggered.
My program recieves the event indicating an alarm is about to display.
This event is passed to SysHandleEvent which displays the alarm.
        The alarm is acknowledged by the user and control returned to
        the OS and then to the interupted program (mine).
SysHandleEvent returns true and my program fetches the next event from
    the queue.
The next event on the Queue is the winExitEvent.  My form handler
    ignores it (returns false).
The next event is the winEnterEvent.  My form ignores it(returns false).
The next call to EvtGetEvent causes the Emulator to throw 

   This program has just read from an unallocated chunk.


What is going on?  It is the same event loop.  I am passing it the same
pointer to the same variable as the first two times through the loop.
The first two times my form's event handler returned false and didn't
change the data _pointed_ to by the pointer much less the pointer
itself.  Using CW debugger verifies that the pointer is still pointing
to valid memory location that contains the winEnterEvent data.  It would
not seem possible that my program could be sending a bad pointer to
EvtGetEvent.    Yet it crashes.  

It can't be the ROM (OS 3.3). It must be my program, but HOW can I make
the OS crash as long as the pointer is vaild?






derik      
 
                     email:  [EMAIL PROTECTED]

                     WWW:    http://www.pobox.com/~derik


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to