RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
WideStrUtils.WStrAlloc Function

Allocates a buffer for a PWideChar and returns a pointer to its first character.

Pascal
function WStrAlloc(Size: Cardinal): PWideChar;
C++
PWideChar WStrAlloc(unsigned Size);

WStrAlloc allocates a buffer for a PWideChar with a maximum length of Size - 1 (1 byte must be reserved for the termination character). The result points to the location where the first character of the string is to be stored. A 32-bit number giving the total amount of memory allocated is stored in the four bytes preceding the first character; it is equal to Size * 2 + 4. If space for a string is allocated with WStrAlloc, it should be deallocated via WStrDispose

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!