/*
I want to make application starting when system wakes up.
I am using Mobile Studio Lab version 1.1.
I was trying various ROM versions 4,0 3.5 3.1.
I have read that rom 3.5 is incompatible, true,
even FrmAlert doesnot work from NotificationHandler,but this is not
the case. When I make it working on rom 4.0 its fine.
I used SysNotifyRegister ( cardNo, dbID,
sysNotifyLateWakeupEvent ,NULL,sysNotifyNormalPriority, 0);
I pass Application object pointer to the HandleNotification
function.
I does not work, it crashed.
I tried to start FrmAlert() from inside HandleNotification,
it worked fine,but this is not an normal application.
But why I can NOT start normal application object from
HandleNotification???
Application object process events itself in function
theApp.StartApplication.
I would like to use it like in normal application.
I need to open form at least (and of course process events).
I was testing on POSE not on real palm device.
Piotr
Here is the code I was using.
*/
DWord PilotMain (Word cmd, Ptr cmdPBP, Word launchFlags)
{
switch (cmd)
{
case sysAppLaunchCmdSystemReset:
case sysAppLaunchCmdSyncNotify:
break;
case sysAppLaunchCmdNotify:
{
CNewPwdApp theApp;//it makes system crash, even if theApp is not
Started in HandleNotification
HandleNotification (theApp, (SysNotifyParamType *) cmdPBP);
break;
}
case sysAppLaunchCmdNormalLaunch://with normal start applicatin
works fine
{
CNewPwdApp theApp;
theApp.StartApplication (cmd, cmdPBP, launchFlags);
}
break;
}
return 0;
}
//----------------------------------------------------------------------
// The function that handles the notifications
static void HandleNotification (CNewPwdApp * pApp, SysNotifyParamType * np)
{
switch (np->notifyType)
{
case sysNotifyLateWakeupEvent:
// do stuff
pApp->StartApplication (cmd, cmdPBP, launchFlags);
break;
}
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
- more problems with starting application on sysNotifyLateWak... Piotr Banasiak
- more problems with starting application on sysNotifyLa... Piotr Banasiak
