/*
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 used SysNotifyRegister ( cardNo, dbID, sysNotifyLateWakeupEvent
,NULL,sysNotifyNormalPriority, 0);
I pass Application object pointer to the HandleNotification function.
I doesnot 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 appliation 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).
*/
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
- Piotr Banasiak
