Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SysAllocStringLen function

Allocates a new string, copies the specified number of characters from the passed string, and appends a null-terminating character.

Syntax


BSTR SysAllocStringLen(
  _In_ const OLECHAR *strIn,
  _In_       UINT    ui
);

Parameters

strIn [in]

The input string.

ui [in]

The number of characters to copy. A null character is placed afterwards, allocating a total of ui plus one characters.

Return value

A copy of the string, or NULL if there is insufficient memory to complete the operation.

Remarks

The string can contain embedded null characters and does not need to end with a NULL. Free the returned string later with SysFreeString. If strIn is not NULL, then the memory allocated to strIn must be at least ui characters long.

Note  This function does not convert a char * string into a Unicode BSTR.
 

Requirements

Header

OleAuto.h

Library

OleAut32.lib

DLL

OleAut32.dll

See also

String Manipulation Functions

 

 

Show:
© 2017 Microsoft