Share via


SysStringLen

This function returns the length of a BSTR.

HRESULT SysStringLen(
  BSTR bstr 
); 

Parameters

  • bstr
    [in] Unicode string that was allocated previously.

Return Values

The number of characters in bstr, not including a terminating null character, indicates success. If the bstr parameter is null then zero is returned.

Remarks

The returned value may be different from _fstrlen(bstr) if the BSTR was allocated with SysAllocStringLen, SysReAllocStringLen, or SysAllocStringByteLen, and the passed-in characters included a null character in the first cch characters. For a BSTR allocated with SysAllocStringLen, SysAllocStringLen, or SysAllocStringByteLen, the SysStringLen function always returns the number of characters specified in the cch parameter at allocation time.

Windows CE supports only Unicode strings.

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

Requirements

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

See Also

BSTR | SysAllocStringLen | SysReAllocStringLen | SysAllocStringByteLen

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.