SysStringLen Function

Returns the length of a BSTR.

UINT SysStringLen(
  BSTR  bstr
);

bstr

A BSTR allocated previously.

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

The returned value may be different from strlen(bstr) if the BSTR contains embedded Null characters. This function always returns the number of characters specified in the cch parameter of the SysAllocStringLen function used to allocate the BSTR.

// Display the status message.
//
TextOut(
   hdc,
   rcMsg.left + (m_dxFont / 2),
   rcMsg.top + ((rcMsg.bottom - rcMsg.top - m_dyFont) / 2),
   m_bstrMsg, SysStringLen(m_bstrMsg));
Show:
© 2014 Microsoft