"Danny Epstein" <[EMAIL PROTECTED]> wrote in message news:<73593@palm-dev-forum>...
> > > I put in code to handle the sysAppLaunchCmdSyncNotify > > launch code, but found that DmFindDatabase (to get > > the app's dbID using its database name) does not work > > in this context - the find fails. > I don't know why this isn't working, but you can use SysCurAppDatabase to > get your card number and LocalID. (It seems like I've been saying this a lot > lately; I guess the fact that this API isn't in the Data Manager explains > why people don't know about it.) I knew about this call, but from reading the docs, I figured that I would get the HotSync app's dbID, not mine, since the sync notify arrives via sublaunch. My app isn't actually the "current app" in this context, is it? > > If instead I use DmGetNextDatabaseByTypeCreator, I can find the app, but > > unfortunately, calling SysUIAppSwitch to launch the app [doesn't work]. > The HotSync app is probably "eating" the appStopEvent enqueued by > SysUIAppSwitch. Try Peter's suggestion - using an alarm to delay the switch. > The problem with this is what delay do you use? Too short and it won't work. > Too long and it'll pause for a while. And worse, this code has to work back to Palm OS 3.0, so the alarm manager isn't an option. > Alternatively, do your self-extracting directly in the syncNotify sublaunch. > I'd be concerned about this for several reasons. (1) Limited stack, dynamic > heap, etc. (2) Changing the list of databases while iterating over it. (3) > The user isn't expecting the "cleaning up" phase to take long. I'm concerned about that approach too. I've had horrible problems in the past caused by doing "too much" during this launch code, and it does make for a bad user experience. > The design of Palm OS doesn't really support what you're trying to do; your > best bet may be to let the user invoke the self-extracting app manually. That is my fall-back position. > Another approach to self-extracting is to make the self-extracting app look > like the app that's inside the archive. When you first run it, it starts > with an extraction and then runs normally. This is similar to the "first > run" approach Microsoft uses in their Mac apps. That's the way the first version worked, and the second was similar with a couple wrinkles. I'm working on version three now, and I'm just prototyping to see what improvements are possible. The self-launching would've been nice, but it sounds like it isn't worth the effort. Thanks for your suggestions! Mark Peters -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
