At 01:16 PM 6/4/2003 +0300, iyad abu-shaera wrote:
I tried the following code to return back after hotsync:
case sysAppLaunchCmdSyncNotify:
        cmdPBP->purgeAlarm = true;
        SysCurAppDatabase( &cardNo, &appID );
        AlmSetAlarm( cardNo, appID, 10101, TimGetSeconds() + 5, 0 );
        break;

Careful here, your PRC will ONLY get sent this syncNotify launch code if a PDB belonging to it, e.g., same crId, has been -modified-. The idea is for your app to have a chance to do some cleanup/processing after data has been added/modified/removed to one of its databases. If you are running an OS that has the Notification Manager, registering for sysNotifySyncFinishEvent is your best bet to set this alarm, rather than sysAppLaunchCmdSyncNotify... the former will be broadcast regardless of whether databases have been updated, etc.


case sysAppLaunchCmdAlarmTriggered:
        AppLaunchWithCommand('ESTB', 0, NULL);
        break;

Ensure AppLaunchWithCommand uses SysUIAppSwitch(), not SysAppLaunch()!


If it still acts funny, a last resort would be to increase the alarm time.

the hotsync started then hanged up after a while, I think that my application trying to launch while the hotsync synching.. so there is a system event that notify after the hotsync finished?

If changing to a SysUIAppSwitch() in AppLaunchWithCommand() does not work or is not applicable, you should set a breakpoint in your notification / launch code handlers and see what's going on. Pay attention to the call stack when your app is launched following the HotSync ... your PilotMain() should NOT be nested inside of any HotSync Manager functions, otherwise it means you are being sublaunched from inside of HotSync Manager, which you don't want. Using a SysUIAppSwitch() should prevent this from happening.


You can set up the Simulator to do a sync, and this will allow you to step through absolutely everything. I'm sure you can figure out what's going on if you go through the steps to do this:

http://www.palmos.com/dev/support/docs/conduits/win/Util_Simulator.html#970823

Best of luck,
-Jeff Ishaq


-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to