Hi > ExgSetDefaultApplication (appCreatorID, exgRegTypeID, "application/vnd.palm\tapplication/x-pilot");
There is a bad separator (".") between 2 strings. On the other hand, even if you correct it, the result will be (I guess) the same. I slightly remember similar experiments in the past and that the conclusion was negative. But the details are unclear in my mind. Nevertheless, I made fast experiments using Resco Explorer (allows you to manipulate associations in any way you want) and redefined the associations for the types you list + for the pdb, yet it was always "Applications" who received the beamed prc. Moreover, I observed also that the prc/pdb associations were restored to the original values at some instant. So it looks like these associations are forced by the OS. Best regards, Jan Slodicka ----- Original Message ----- From: "Dr. Vesselin Bontchev" <[EMAIL PROTECTED]> To: "Palm Developer Forum" <palm-dev-forum@news.palmos.com> Sent: Thursday, April 21, 2005 6:08 PM Subject: How to intercept application beaming? > Hello folks, > > I've asked this question before and didn't get any answers. Now I have some specific code that doesn't work, so I thought I'd ask again. > > Basically, I want my application to receive the applications beamed to the device on which it is installed, so that it can inspect them first. So far I've tried the following: > > UInt32 PilotMain (UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags) > { > switch (cmd) > { > case sysAppLaunchCmdSystemReset: > case sysAppLaunchCmdSyncNotify: > RegisterForNotifications (); > break; > case sysAppLaunchCmdExgReceiveData: > ReceiveDatabase ((ExgSocketPtr) cmdPBP); > break; > default: > break; > } > return 0; > } > > That is, on application installation and on reset, I register my application to receive the applications beamed to the device and when data has been received by the application, it tries to receive the beamed application. > > RegisterForNotifications works does just > > void RegisterForNotifications (void) > { > ExgRegisterData (appCreatorID, exgRegExtensionID, "PRC"); > ExgRegisterData (appCreatorID, exgRegTypeID, "application/vnd.palm\tapplication/x-pilot"); > ExgSetDefaultApplication (appCreatorID, exgRegExtensionID, "PRC"); > ExgSetDefaultApplication (appCreatorID, exgRegTypeID, "application/vnd.palm\tapplication/x-pilot"); > ExgSetDefaultApplication (appCreatorID, exgRegCreatorID, "lnch"); > } > > where appCreatorID is #defined as the creator ID of my application. > > Receiving the beamed application is done like this: > > Err ReadDBData (void *dataP, UInt32 *sizeP, void *userDataP) > { > Err err; > > *sizeP = ExgReceive ((ExgSocketPtr) userDataP, dataP, *sizeP, &err); > return err; > } > > Boolean DeleteProc (const Char *nameP, UInt16 version, UInt16 cardNo, LocalID dbID, void *userData) > { > return false; > } > > Err ReceiveDatabase (ExgSocketPtr exgSocket) > { > LocalID dbID; > Boolean doReset; > Err err; > > err = ExgAccept (exgSocket); > if (err == errNone) > { > err = ExgDisconnect (exgSocket, ExgDBRead (ReadDBData, DeleteProc, exgSocket, &dbID, 0, &doReset, true)); > SndPlaySystemSound (sndWarning); // Show that we're alive > // Do something with the received database (referred to by dbID) > } > return err; > } > > Yet the above code doesn't work. That is, I don't get any beeps and it is apparently still the Launcher that is receiving the beamed applications. What am I missing? > > Regards, > Vesselin > -- > For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/