You can hook SysHandleEvent with a routine that's been copied into
dynamic RAM. The routine deletes your database and calls SysReset() so
that the routine, itself, is eliminated.
Contact me directly for code.
Alex
Marco Pantaleoni wrote:
>
> Hi,
> does anyone knows if it is possible to remove the running application
> from the storage upon exit ?
> The naive solution using DmDeleteDatabase(), as in the code snippet
> below, doesn't work, since the application database has an open
> count greater that zero (at least on Palm OS 3.5):
>
> DmOpenRef dbPrcP;
> LocalID dbPrcID;
> UInt16 dbPrcCardNo;
> UInt16 attributes;
> Err err = 0;
>
> /* remove the PRC */
> dbPrcP = DmOpenDatabaseByTypeCreator( 'appl', appCreator, dmModeReadOnly );
> if (! dbPrcP)
> {
> err = DmGetLastErr();
> return err;
> }
> DmDatabaseInfo( dbPrcCardNo, dbPrcID, NULL, &attributes, NULL, NULL,
> NULL, NULL, NULL, NULL, NULL, NULL, NULL );
> attributes |= dmHdrAttrRecyclable;
> DmSetDatabaseInfo( dbPrcCardNo, dbPrcID, NULL, &attributes, NULL, NULL,
> NULL, NULL, NULL, NULL, NULL, NULL, NULL );
> DmCloseDatabase( dbPrcP );
> err = DmDeleteDatabase( dbPrcCardNo, dbPrcID );
>
> As you can see, I've also tried to set the dmHdrAttrRecyclable, without
> results. In another test, I've tried also DmDatabaseProtect(), but ...
> Any clue ?
>
> TIA,
> Marco
>
> --
> ========================================================================
> Marco Pantaleoni [EMAIL PROTECTED]
> Padova, Italy [EMAIL PROTECTED]
> elastiC language developer http://www.elasticworld.org
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/