At 07:20 PM 28/3/2002 -0800, you wrote:
>Matt -
>
>If my code gets to that point - there is a record in the database.
>
>I have been running my program through Gremlins and on the line
> skelClientsDBType *p = (skelClientsDBType *) MemHandleLock(h);
>
>I am getting chunk overlocked errors on that line.
>
>Can anyone see something wrong with the code below?
>
>I thought I knew what the error meant but
> if (h) { // could fail due to out of memory!
> MemPtr p = MemHandleLock(h);
> Err err = DmWrite(p, 0, &r, sizeof(r));
> MemPtrUnlock(p);
> DmReleaseRecord(gACWorkDB, recIndex, true);
> MemHandleUnlock(h);
> }
>
>Thanks,
>Ed
Looks more like you should be getting chunk underlocked. When you do a
MemPtrUnlock on a pointer that points to a locked handle, it actually
unlocks the handle. See the docs. So you should not be able to unlock the
handle afterwards. Also, using DmQueryRecord does not mark the record as
busy (it is read-only), so there is no need to DmReleaseRecord (in other
words you should not do this).
Matt
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/