"Drew Tennenbaum" <[EMAIL PROTECTED]> wrote:
> When you are done using the handle to the record free the memory. You can do as
>many DmGetRecords as you'd like, they will return new handles to new records.
in response to this:
> >>> [EMAIL PROTECTED] 07/27/00 08:35AM >>>
> So, after every h=DmGetRecord(db, r), I should do a MemHandleFree(h)?
> But if I do that, I can't do anymore DmGetRecord(db, r)
>
> Richard Hartman wrote:
> >
> > Your are not allocating memory for the chunk you are using, but you
> > are kind of laying claim to it for a while. Yes, you should release
> > the record handle when you are done with it.
Drew, don't do that! As long as the record is attached to a database,
there had better be a valid handle for it.
To answer the original question: when you use DmGetRecord, you use
DmReleaseRecord when you're done with it. DmGetRecord marks the record
as busy and returns the record handle. DmReleaseRecord marks the record
as not busy. If you don't intend to change the record, you can use
DmQueryRecord instead of DmGetRecord, and then you don't need to (in
fact, you should not) use DmReleaseRecord.
If you want to completely dispose of a record, use DmDeleteRecord or
DmRemoveRecord. They both detach the record from the database, making
it safe to then delete the record's handle. The difference is that
DmDeleteRecord waits until the next HotSync to actually delete the
handle, but DmRemoveRecord deletes the handle immediately.
--
Roger Chaplin
<[EMAIL PROTECTED]>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/