Tam Hanna wrote:
I already tried out to modify the code, and it now looks like this:
FormPtr myform;
myform=FrmInitForm(SyncForm);
FrmDrawForm(myform);
FrmSetActiveForm(myform);
FrmSetEventHandler(myform, HsFormHandleEvent);
Still, I get the fatalm alert when the notification comes in and my app
isn't the running one. BTW, the form has the ID 1500, and it has two buttons
and a TBMP resource on it(1102, 1206, 1000). Can this be an overlap problem?
If your app isn't the currently-active one when you set that form
handler for the form, how do you know that you are supplying a valid
function pointer?
I don't know the specifics of how executables are loaded on Palm OS,
but it certainly seems like some kind of relocation has to be done
since different segments are in different PRC records and must be
locked (and thus their pointers determined) separately, which means
the offsets between them would not be constant.
So, one idea is, if HsFormHandleEvent() isn't in your main segment,
move it in there.
Hmm, another idea is to do this as a test: create your own user
event, and then just before you set HsFormHandleEvent() as the
handler, manually call HsFormHandleEvent() and pass it this event,
to which it should respond by doing something you can recognize
(some beeps or a custom alert or something). That way you verify
that you are at least able to call the function at the time you set
it as a handler.
Just a guess, though...
- Logan
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/