SysReAllocStringLen

This function creates a new BSTR that contains a specified number of characters from an old BSTR, and frees the old BSTR.

HRESULT SysReAllocStringLen(
BSTR FAR *pbstr, 
OLECHAR FAR *pch, 
unsigned int cch ); 

Parameters

  • pbstr
    Pointer to a variable that contains a BSTR.
  • pch
    Pointer to cch characters to copy, or NULL to keep the string uninitialized.
  • cch
    Number of characters to copy from pch. A null character is placed afterward, allocating a total of cch+1 characters.

Return Values

TRUE indicates that the string is reallocated successfully. FALSE indicates that insufficient memory exists.

Remarks

The SysReAllocStringLen function allocates a new string, copies cch characters from the passed string into it, and then appends a null character. Frees the BSTR referenced currently by pbstr, and resets pbstr to point to the new BSTR. If pch is NULL, a string of length cch is allocated but not initialized.

The pch string can contain embedded null characters and does not need to end with a NULL.

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.

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.