当创建 < a href=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
例如:
wchar_t* pwNativeString = L"abc def ghi "; // + automatic " "
// Now I want to create a BSTR using _bstr_t by this string.
_bstr_t spBSTR = _bstr_t(pwNativeString);
问题在于构建器依赖于 pwNativeString
的无效终止。 因此, 产生的 BSTR
仅仅是 abc>
, 仅此而已。 因此, 我的问题是 : 如何创建 BSTR
或
_bstr_t spBSTR = _bstr_t(pwNativeString, 15);