[missing-sync-palmos-dev-talk] How does SyncReadNextModifiedRec() work?

Scott Gruby sgruby at markspace.com
Wed Jun 21 20:42:29 PDT 2006


On Jun 21, 2006, at 7:02 PM, Joe Goh wrote:

> On 6/21/06, Scott Gruby <sgruby at markspace.com> wrote:
>> Which application on the handheld are you trying to read the data?
>> Can you provide a snippet of code? It's possible that the database
>> always gets modified after a sync causing this behavior.
>
> I'm trying to read the SMS message database on the Treo 650.
>
> Here's a snippet of what i'm doing.  The rest of the conduit is mostly
> based on the Sample Conduit from the markspace website.
>
> unsigned char database_id = 0;
> 		
> if (SyncOpenDB("Messages Database", DEFAULT_CARD_NUM, database_id,
> eDbRead) == 0)

There's your problem! You're opening the database read only so  
SyncResetSyncFlags will always fail. You should be using:

eDbRead|eDbWrite|eDbShowSecret

instead of eDbRead. I think that will solve your problem.

> {
> 	CRawRecordInfo raw_record;
> 	raw_record.m_FileHandle = database_id;
> 	raw_record.m_TotalBytes = database_info.dwMaxRecSize;
> 	raw_record.m_pBytes = (BYTE *) malloc(raw_record.m_TotalBytes);
> 	raw_record.m_RecIndex = 0;
> 	if (raw_record.m_pBytes == NULL)
> 		goto close_database;
> 			
> 	while (SyncReadNextModifiedRec(raw_record) == 0)
> 	{
> 		// Lots of stuff done here
> 	}
> 			
> close_database:
> 	if (raw_record.m_pBytes != NULL)
> 		free(raw_record.m_pBytes);
> 	SyncResetSyncFlags(database_id);
> 	SyncCloseDB(database_id);
> }
> 		
> ::SyncUnRegisterConduit(conduitHandle);
> unloadBridge();
>
> Any clues?
> Joe
> _______________________________________________
> missing-sync-palmos-dev-talk mailing list
> missing-sync-palmos-dev-talk at lists.markspace.com
> http://lists.markspace.com/mailman/listinfo/missing-sync-palmos-dev- 
> talk
>


--
Scott Gruby
Mark/Space, Inc.
<http://www.markspace.com/>

Please visit <http://www.markspace.com/support/> for assistance with  
Mark/Space products.




More information about the missing-sync-palmos-dev-talk mailing list