未分类--Windows API--_bstr_t::_bstr_t

150 篇文章 0 订阅
31 篇文章 0 订阅

原文来自MSDN Library for Visual Studio 2008 SP1,翻译部分仅为个人观点,想要看更多信息请看MSDN,如有版权问题请联系QQ 643166601,邮件643166601@qq.com

 

Visual C++ Language Reference 
_bstr_t::_bstr_t 


Updated: November 2007

Microsoft Specific

Constructs a _bstr_t object.
构造一个 _bstr_t 对象。
 
_bstr_t( ) throw( );
_bstr_t(
   const _bstr_t& s1
) throw( );
_bstr_t(
   const char* s2
);
_bstr_t(
   const wchar_t* s3
);
_bstr_t(
   const _variant_t& var
);
_bstr_t(
   BSTR bstr,
   bool fCopy
);
 

Parameters
s1
A _bstr_t object to be copied.
一个 _bstr_t 对象被拷贝。
s2
A multibyte string.
一个多字节字符串。
s3
A Unicode string
一个Unicode字符串。
var
A _variant_t object.
一个_variant_t对象。
bstr
An existing BSTR object.
一个存在的BSTR对象。
fCopy
If false, the bstr argument is attached to the new object without making a copy by calling SysAllocString.
如果是false,这个bstr参数附加到新的对象上不需要通过调用SysAllocString去生成一个拷贝。
Remarks
_bstr_t( )   Constructs a default _bstr_t object that encapsulates a NULL BSTR object.
_bstr_t( )构造一个默认的_bstr_t对象封装了一个NULL BSTR对象。
_bstr_t( _bstr_t& s1 )   Constructs a _bstr_t object as a copy of another. This is a "shallow" copy, which increments the reference count of the encapsulated BSTR object instead of creating a new one.
_bstr_t( _bstr_t& s1 ) 构造一个_bstr_t对象作为另一个的拷贝。这个是一个浅拷贝,这个封装的BSTR对象的递增的引用计数器而不是创建一个新的。
_bstr_t( char* s2 )   Constructs a _bstr_t object by calling SysAllocString to create a new BSTR object and encapsulate it. This constructor first performs a multibyte to Unicode conversion.
_bstr_t( char* s2 ) 通过调用SysAllocString构造一个_bstr_t对象去创建一个新的BSTR对象并且封装它。这个构造首先执行多字节到Unicode转换。
_bstr_t( wchar_t* s3 )   Constructs a _bstr_t object by calling SysAllocString to create a new BSTR object and encapsulates it.
_bstr_t( wchar_t* s3 ) 通过调用SysAllocString构造一个_bstr_t对象去创建一个新的BSTR对象并且封装它。
_bstr_t( _variant_t& var )   Constructs a _bstr_t object from a _variant_t object by first retrieving a BSTR object from the encapsulated VARIANT object.
_bstr_t( _variant_t& var )从一个_variant_t对象构造一个_bstr_t对象首先检索封装的VARIANT对象的BSTR对象。
_bstr_t( BSTR bstr | bool fCopy )   Constructs a _bstr_t object from an existing BSTR (as opposed to a wchar_t* string). If fCopy is false, the supplied BSTR is attached to the new object without making a new copy with SysAllocString. This is the method used by the wrapper functions in the type library headers to encapsulate and take ownership of a BSTR, returned by an interface method, in a _bstr_t object.
_bstr_t( BSTR bstr | bool fCopy ) 从一个存在的BSTR构造一个_bstr_t对象(而不是从一个wchar*字符串)。如果 fCopy 是false,这个BSTR提供附加到新对象不用SysAllocString生成一个新的拷贝。这个方法在类型库头文件通过封装函数去封装并且归一个BSTR所有,在_bstr_t对象的接口方法返回。
END Microsoft Specific

See Also
Reference
_bstr_t Class
 Send feedback on this topic to Microsoft.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值