|
<< Click to Display Table of Contents >> Step 7: Using these properties, allocate memory for a record buffer |
![]() ![]()
|
The next step is to make available a memory buffer for record data. A later step will read one record’s worth of data into this buffer. From there, the values of individual fields can be extracted for use. Allocate memory space for the record buffer using the Delphi function AllocMem. The size of this buffer needs to be the size of the record as indicated by the DbiGetCursorProps (in the preceding step). Use the iRecBufSize field of the CURProps structure with the AllocMem function.
var
RecordBuffer: pBYTE; // Buffer into which to load a record
begin
…
RecordBuffer := AllocMem(CursorProps.iRecBufSize);
…
end;