BSTR.3w

Langue: en

Version: Jun 2009 (debian - 07/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

BSTR

NOTES

BSTR is a simple typedef for a wide-character string used as the principle string type in ole automation. When encapsulated in a Variant type they are automatically copied and destroyed as the variant is processed.

The low level BSTR Api allows manipulation of these strings and is used by higher level Api calls to manage the strings transparently to the caller.

Internally the BSTR type is allocated with space for a DWORD byte count before the string data begins. This is undocumented and non-system code should not access the count directly. Use SysStringLen(3w) or SysStringByteLen(3w) instead. Note that the byte count does not include the terminating NUL.

To create a new BSTR, use SysAllocString(3w), SysAllocStringLen(3w) or SysAllocStringByteLen(). To change the size of an existing BSTR, use SysReAllocString(3w) or SysReAllocStringLen(3w). Finally to destroy a string use SysFreeString(3w).

BSTR's are cached by Ole Automation by default. To override this behaviour either set the environment variable 'OANOCACHE', or call SetOaNoCache(3w).

SEE ALSO