SysAllocString

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
    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 into this function any invalid and, under some circumstances, NULL pointers will result in unexpected termination of the application.

You can free strings created with SysAllocString using SysFreeString.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Oleauto.h   Oleaut32.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.