BSTR和QString互转
1、QString转BSTR:
std::wstring str_ = QString("some texts").toStdWString(); BSTR bstr_ = SysAllocString(str_.c_str());
2、BSTR转QString:
BSTR bstrTest = SysAllocString(L"ConvertMe"); QString qstringTest = QString::fromUtf16(bstrTest);
1、QString转BSTR:
std::wstring str_ = QString("some texts").toStdWString(); BSTR bstr_ = SysAllocString(str_.c_str());
2、BSTR转QString:
BSTR bstrTest = SysAllocString(L"ConvertMe"); QString qstringTest = QString::fromUtf16(bstrTest);