RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDataContext.SetDataPointer Method

Stores a pointer in the internal cache of pointers.

Pascal
procedure SetDataPointer(Index: Integer; P: Pointer);
C++
__fastcall SetDataPointer(int Index, void * P);

SetDataPointer stores a pointer that can later be retrieved by a call to GetDataPointer. TDataContext owns only the pointer, not the data to which it points. When you free the TDataContext instance, it frees its list of pointers, but not the memory to which they point, unless they are first obtained by a call to the AllocData method. 

Index is the index of the pointer in the internal cache of pointers, where 0 specifies the first pointer, 1 specifies the second pointer, and so on. 

P is the pointer to store.

Note: TDataContext does not actually allocate the memory to store these pointers. Descendant classes must initialize the internal dynamic array that TDataContext uses to store pointers.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!