Hello,
Greg Winton wrote:
> DmResizeRecord() will work, and yes you need to call DmReleaseRecord().
I have a question about the right way to resize a record when
I already have a handle to the record. i.e. Which should I use
MemResizeHandle() or DmReleaseRecord()?
What I want to do is
1. prepare a large enough size of record.
2. lock it, write some data to it, and unlock it.
3. resize it to the actual size written.
Here is a pseudo code (error checking omitted)
h = DmNewRecord(db, index, MAX_SIZE);
p = DmHandleLock(h);
size = MyWriteData(p); // write some data and return
// the actual size written.
DmHandleUnlock(h);
// I want to shrink the record here (1),
DmReleaseRecord(db, index, true);
// or here (2).
How should I do? Which is better?
a. put MemResizeHandle(h, size); to (1).
b. put DmResizeRecord(db, index, size); and DmReleaseRecord(db, index, true);
to (2).
hoshi