System.SysUtils.TMarshaller.InString

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function InString(SB: TStringBuilder; MaxLen: Integer): TPtrWrapper;

Properties

Type Visibility Source Unit Parent
function public System.SysUtils.pas System.SysUtils TMarshaller

Description

Returns a wrapped pointer to an allocated memory buffer.

The InString method returns a wrapped pointer to an allocated memory buffer which is expected to receive a null-terminated UTF-16 string. When the marshaller is flushed or goes out of scope, the null-terminated string is copied out of the buffer into the provided TStringBuilder object, SB. MaxLen specifies the maximum number of characters, not including the null terminator.

Note: This must be at least as large as the longest string that can be copied into the buffer, otherwise memory corruption may occur.

See Also