Hi All,
I'm using SysNotifyRegister in my app and need to pass in some data that
gets passed back when the event has occurred..
I seem to be having trouble though when it comes to reading back my data
when the notification occurs.
Could anyone please enlighten me as to what I'm missing..
Here's the code I have right now, though I've tried numerous other ways with
the same results.
// Register for notification
MyPrefsType myPrefs; // values are populated elsewhere
err =
SysNotifyRegister(cardNo,dbID,sysNotifyCardRemovedEvent,NULL,sysNotifyNormal
Priority,&myPrefs);
// the fianl argument "myPrefs" is a global struct used as the app
preferences.
// Handle receiving notification
MyPrefsType *data;
case sysAppLaunchCmdNotify:
if (((SysNotifyParamType*)cmdPBP)->notifyType ==
sysNotifyCardRemovedEvent)
{
// Get the data that was passed to the notification
data = (((SysNotifyParamType*)cmdPBP)->userDataP);
ReadData(*data); // trying to pass the actual values of this pointer to a
function which does something with it.
}
The final call to "ReadData" takes a MyPrefsType as the argument.
The values I get back though are all garbled and are surely not what I
passed to the notification call.
I'm thinking its a pointer problem but don't know how to resolve it.
Thank you for any help in advance
Regards,
Jim
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/