RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
WideStrUtils.WStrNew Function

Allocates space on and copies a PWideChar to the heap, returning a new PWideChar.

Pascal
function WStrNew(const Str: PWideChar): PWideChar;
C++
PWideChar WStrNew(const PWideChar Str);

WStrNew allocates a copy of Str on the heap.  

If Str is nil (Delphi) or NULL (C++) or points to an empty string, WStrNew returns a pointer to a new empty PWideChar. 

Otherwise, WStrNew makes a duplicate of Str, obtaining space with a call to WStrAlloc, and returns a pointer to the duplicated PWideChar. 

The allocated space is the length of Str * 2 + 5 bytes. 

 

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