Thanks for the replies!

I found that when the old AddressDB database is open the OS also seems
to open the ContactsDB-Padd database.  My app had the AddressDB open
when I tried to call DmDeleteDatabase() for Contacts-Padd and I got a
dmErrDatabaseOpen error.  Closing the AddressDB fixed this issue.  I
just wanted to mention it here for posterity since I didn't see this
documented anywhere.  I would imagine the same holds true for the other
PIM apps.  I just started with the Address Book.

Thanks,

Aaron Hansen


P.S. 
Since mgou said that the OS sends a sysNotifyDBDeletedEvent
automatically when DmDeleteDataBase() is called for the AddressDB, it
seems like the Address PIM should take this as a hint to also delete the
ContactsDB-Padd.  This is the behavior I would have expected at least.
Just a thought for the Palm folks that might be listening.


P.P.S.
The code snippet I posted below doesn't work.  You need to build a
SysNotifyParamType struct and place the SysNotifyDBDeletedType struct
inside it in notifyDetailsP.  Then it will work.  Just thought I'd
mention that too in case someone was looking for an example of
broadcasting Notify Events.

 
>-----Original Message-----
>From: [EMAIL PROTECTED] 
>[mailto:[EMAIL PROTECTED] On Behalf Of Neil 
>Whitworth
>Sent: Tuesday, February 01, 2005 2:03 AM
>To: Palm Developer Forum
>Subject: Re: Deleting AddressDB on Treo650
>
>
>Aaron Hansen wrote:
>The Treo 650 (And T3 & T5) have a new 'Contacts' application. 
>This uses 
>a different creator ID (Padd) then the old app. The old AddressDB 
>database is kept uptodate from the new database to allow old 3rd party 
>apps to still use the addressDB directly.
>
>You will need to delete the ContactsDB-Padd database on these devices.
>
>
>> My app needs to delete all contacts from this device.  It 
>looks like I 
>> should use the Notification Manager to broadcast 
>> SysNotifyDBDeletedEvent to the Contacts app to let it know I deleted 
>> the AddressDB.  Is this correct?
>> 
>> I haven't been able to find any documentation that speaks 
>directly to 
>> this.  Right now if I only delete the AddressDB it looks like the 
>> contacts app is recreating the AddressDB from the ContactsDB-Padd 
>> database.
>> 
>> Here is a snippet of code (is this right?):
>> 
>>    ETINT32 retval = ERR_Success;
>>    LocalID dbID;
>>    Err err = ERR_Success;
>>    
>> 
>>    dbID = DmFindDatabase(0, addrDBName);
>>    
>>    // Call the base class DeleteAllLocalRecords to remove 
>the AdressDB
>>    retval = EPalmDatastoreBase::DeleteAllLocalRecords();
>>    
>>    if( retval == ERR_Success )
>>    {
>>       // Check for Notification feature
>>      ETUINT32 value;
>>      err = FtrGet( sysFtrCreator, sysFtrNumNotifyMgrVersion, 
>&value );
>>       
>>       if( err == ERR_Success && value )
>>       {
>>          // Notification Manager is available
>>          
>>          SysNotifyDBDeletedType dbInfo;
>>          
>>          dbInfo.oldDBID    = dbID;
>>          dbInfo.cardNo     = 0;
>>          dbInfo.dbName     = addrDBName;
>>          dbInfo.creator    = addrDBCreator;
>>          dbInfo.type       = addrDBType;
>>          
>>          err = SysNotifyBroadcastDeferred( &dbInfo, sizeof( 
>> SysNotifyDBDeletedType ) );
>>       }
>>    }
>> 
>> Thanks,
>> 
>> Aaron Hansen
>> 
>> 
>
>-- 
>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/

Reply via email to