Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
A version of this page is also available for
4/8/2010
This function retrieves the length of a string.
Syntax
UINT SysStringLen( BSTR bstr ); |
Parameters
- bstr
-
[in] Unicode string that was allocated previously.
Return Value
The number of characters in bstr, not including a terminating null character, indicates success.
If the bstrparameter is null, zero is returned.
Remarks
The returned value can be different from _fstrlen( bstr) if the following occurred:
- If
BSTRwas allocated with
SysAllocStringLen,
SysReAllocStringLen, or
SysAllocStringByteLen
- If the passed-in characters included a null character in the
first
cchcharacters
For a BSTRallocated with SysAllocStringLen, SysAllocStringLen, or SysAllocStringByteLen, the SysStringLenfunction retrieves the number of characters specified in the cchparameter at allocation time.
Windows Embedded CE and Windows Mobile only support Unicode strings.
Passing invalid (and under some circumstances NULL) pointers to this function causes an unexpected termination of the application.
Requirements
Header | oleauto.h |
Library | oleaut32.lib |
Windows Embedded CE | Windows CE 2.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |