我正在尝试将 a 转换wchar_t *
为BSTR
.
#include <iostream>
#include <atlstr.h>
using namespace std;
int main()
{
wchar_t* pwsz = L"foo";
BSTR bstr(pwsz);
cout << SysStringLen(bstr) << endl;
getchar();
}
这打印出来0
,比我希望的要少。进行这种转换的正确方法是什么?