SyntaxFix
Write A Post
Hire A Developer
Questions
BSTR to std::wstring:
BSTR
std::wstring
// given BSTR bs assert(bs != nullptr); std::wstring ws(bs, SysStringLen(bs));
std::wstring to BSTR:
// given std::wstring ws assert(!ws.empty()); BSTR bs = SysAllocStringLen(ws.data(), ws.size());
Doc refs:
std::basic_string<typename CharT>::basic_string(const CharT*, size_type)
std::basic_string<>::empty() const
std::basic_string<>::data() const
std::basic_string<>::size() const
SysStringLen()
SysAllocStringLen()