COM string

来源:互联网 发布:网上卖东西除去淘宝 编辑:程序博客网 时间:2024/04/29 10:21

To handle BSTR string type, we need use Windows API functions:

SysAllocString(), SysAllocStringLen(), SysAllocStringByteLen(),

SysReAllocString(),  SysReAllocStringLen(),

adn SysFreeString

also you can take use of class CComBSTR and _bstr_t.

The CComBSTR class is a wrapper for BSTRs, length-prefixed strings. The length is stored as an integer at the memory location preceding the data in the string.

Class _bstr_t is one of the compiler COM support classes declared in COMDEF.H. It wraps the BSTR type to provide useful operators and methods. See the Compiler COM Support Classes for more information.

原创粉丝点击