SysAllocString
TOC
Collapse the table of content
Expand the table of content

SysAllocString

Windows CE .NET

This function allocates a new string and copies the passed string into it. SysAllocString returns null if there is insufficient memory or if a null pointer is passed in.

BSTR SysAllocString(
  OLECHAR FAR* sz 
); 

Parameters

sz
[in] Null-terminated string to copy. The sz parameter must be a Unicode string in 32-bit applications, and an ANSI string in 16-bit applications.

Return Values

A pointer to a BSTR that contains the string indicates success. NULL indicates that insufficient memory exists or the sz parameter was NULL.

Remarks

Windows CE supports only Unicode strings.

Passing invalid (and under some circumstances NULL) pointers to this function causes an unexpected termination of the application.

You can free strings created with SysAllocString using SysFreeString.

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Oleauto.h.
Link Library: Oleaut32.lib.

See Also

SysFreeString


Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.

Show:
© 2016 Microsoft