> -----Original Message-----
> From: Paul Nevai
> Sent: Wednesday, July 16, 2003 2:20 PM
> 
> I couldn't figure it out from the available documentation 
> that if I do a
> VFSImportDatabaseFromFileCustom() job then the associated DBs 
> [via dmHdrAttrBundle] get imported too or else I need to take 
> care of the importation job myself.

VFSImportDatabaseFromFile() imports exactly one file, and that's the one
you specify.  So you would manually have to compile a list of all
databases on the card that you wish to import (I'd use VFSFileDBInfo()),
and then loop through and do your VFSImportDatabaseFromFile() call for
each file.

Be very careful.  VFSImportDatabaseFromFile() will enqueue a
sysAppLaunchCmdSyncNotifylaunch code each time it imports a database
belonging to an application.  This is problematic in this scenario:  you
are importing an application that has 1 appl and 5 supporting PDBs.
This application, upon receiving a sysAppLaunchCmdSyncNotify, performs
some one-time initialization on its 5 databases because it thinks it's
just been installed via a hotsync.  But lo and behold,
VFSImportDatabaseFromFile() queues up five separate
sysAppLaunchCmdSyncNotify, and only the last one sent occurs when all 5
supporting PDBs exist on the device.  Very likely, the prior 4 will
cause a big, fat crash.

As for DmDeleteDatabase, it deletes exactly one database, and that's the
one you specify.  Palm's built-in deletion application (go to Launcher
menu and do 'Delete') shows mostly files of type 'appl'.  Any PDBs that
belong to the appl you delete also get deleted automatically.  If you
wish to mimic this behavior, you will need to again compile a list of
all PDBs you wish to delete (use SysCreateDataBaseList() and wildcards),
and then loop through each database calling DmDeleteDatabase() for each
file.

I emphasize creating the list of files-to-delete prior ever to calling
DmDeleteDatabase().  Only once this list is complete do you want to
begin your DmDeleteDatabase() calls.  In other words, you do NOT want to
find AND delete databases in the *same* loop or strange things can begin
to happen.  This is similar to the classic programming error of changing
your loop invariant inside the loop itself.

> Based on the lack of the word "dmHdrAttrBundle" in the 
> released source code, my guess is that the job needs to be 
> done manually. But then how come that the published source 
> code of McPhling doesn't contain the word "dmHdrAttrBundle" 
> either, and if it were a problem, Mike would know about it. Any ideas?

I think this attribute is used mostly for beaming/sending files, and not
for moving files around with VFS/Data managers.

-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