更新时间:2016-10-14 10:34:06浏览次数:1+次
#include <iostream>
using namespace std;
#include "comutil.h"
void main()
{
string str="这是一个字符串";
BSTR bstr = (_bstr_t)str.c_str();//string转到BSTR
string str2 = (_bstr_t)bstr;//BSTR转到string
}
BSTR bstr = (_bstr_t)str.c_str();//string转到BSTR
//_bstr_t类构造函数
_bstr_t() throw();
_bstr_t(const _bstr_t& s) throw();
_bstr_t(const char* s) ;
_bstr_t(const wchar_t* s) ;
_bstr_t(const _variant_t& var) ;
_bstr_t(BSTR bstr, bool fCopy) ;
//_bstr_t的赋值操作符重载
_bstr_t& operator=(const _bstr_t& s) throw();
_bstr_t& operator=(const char* s) ;
_bstr_t& operator=(const wchar_t* s) ;
_bstr_t& operator=(const _variant_t& var) ;
相关资讯