I use DmGetLastErr() to get the error code, it is
$020E(dmErrorClass,dmErrROMBased). Does it mean that I use ROM to store DB? But it is
impossible because I created the "UnknownDB", and I added elements into it. If the DB
is saved in ROM, I would not permit to do it.
>Some error occur when I call DmGetRecord() func. the source like this:
>
>static void ModifyRecord( UInt objIndex, UInt idx )
>{
> UnknownRec rec, *pRec;
> UInt pos;
> VoidHand hRec;
> Int16 selected;
>
> rec.index = idx;
> rec.secs = TimGetSeconds ();
> selected = GetInfo( objIndex );
> pos = DmFindSortPosition( UnknownDB, &rec, 0, (DmComparF *) CompareRecFunc, 0
>);
> hRec = DmGetRecord( UnknownDB, pos - 1 );
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~error!
> pRec = MemHandleLock( hRec );
> if ( pRec->index == idx ) {
> if ( selected ) {
> rec.times = 3;
> } else {
> rec.times--;
> }
> DmWrite( pRec, 0, &rec, sizeof(rec) );
> } else {
> if ( selected ) {
> addUnknown( idx );
> }
> }
> MemHandleUnlock( hRec );
> DmReleaseRecord( UnknownDB, pos - 1, true );
>}
>
>When DmGetRecord() was called, pos = 2 & UnknownDB had been opened.
>Do someone can tell me why? Thanks!
>
Sincere,
xfguo
[EMAIL PROTECTED]
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/