Try getting the dbID before calling SysUIAppSwitch...
Gavin. Steve Janaway <[EMAIL PROTECTED]> wrote in message news:96939@palm-dev-forum... > > > > Gavin Maxwell wrote: > > > > It's pretty easy really... just respond to the sysAppLaunchCmdSystemReset > > launch code by launching yourself... to be nice you might like to do it via > > an alarm. That is, get the Reset launch code, set yourself an alarm, then > > when you receive the sysAppLaunchCmdDisplayAlarm launch code you can launch > > yourself. This is how I've done it in the past (though in response to the > > end of a HotSync, as opposed to reset - but the same idea applies). > > > Hi, > > Yep that does help. Cheers. But now I get a very strange problem. I have > the code below. 'appFileCreator' is set to the Creator ID of my > application. But when I reset or do a HotSync I get the preferences > panel launched !! Anyone got any idea's where I've gone wrong. > > All help is very much appreciated. > > Steve > > Err error; > LocalID dbID; > UInt16 cardNo; > DmSearchStateType theSearchState; > > error = RomVersionCompatible (ourMinVersion, launchFlags); > if (error) return (error); > > switch (cmd) > { > case sysAppLaunchCmdNormalLaunch: > // normal application launch > error = AppStart(); > if (error) > return error; > FrmGotoForm(MainForm); > AppEventLoop(); > AppStop(); > break; > > case sysAppLaunchCmdSystemReset: > // Soft Reset > // Grab the id of the application > DmGetNextDatabaseByTypeCreator(true, &theSearchState, > sysFileTApplication, appFileCreator, true, &cardNo, &dbID); > // Set Alarm for 5 seconds time > AlmSetAlarm(cardNo,dbID,1,5,true); > break; > > case sysAppLaunchCmdSyncNotify: > // HotSync > // Grab the id of the application > DmGetNextDatabaseByTypeCreator(true, &theSearchState, > sysFileTApplication, appFileCreator, true, &cardNo, &dbID); > // Set Alarm for 5 seconds time > AlmSetAlarm(cardNo,dbID,1,5,true); > break; > > case sysAppLaunchCmdDisplayAlarm: > // Alarm from above was triggered > // Launch the new app. > SysUIAppSwitch(cardNo, dbID, sysAppLaunchCmdNormalLaunch, NULL); > break; > > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
