SysStringByteLen

bstr)
BSTR
bstr

Returns the length in bytes of a BSTR. Valid for 32-bit systems only.

Parameter

bstr

A BSTR previously allocated. It cannot be NULL.

Return Value

The number of bytes in bstr, not including a terminating null character.

Comments

The value returned may be different from fstrlen(bstr), if the BSTR was allocated with Sys[Re]AllocStringLen or SysAllocStringByteLen, and the passed-in characters included a null character in the first len characters. For a BSTR allocated with Sys[Re]AllocStringLen or SysAllocStringByteLen, this function always returns the number of bytes specified in the len parameter at allocation time.

Example

// Draw the status message

//

TextOut(

hdc,

rcMsg.left + (m_dxFont / 2),

rcMsg.top + ((rcMsg.bottom - rcMsg.top - m_dyFont) / 2),

m_bstrMsg, SysStringByteLen(m_bstrMsg));

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples