【发布时间】:2013-12-27 10:11:05
【问题描述】:
我在 BSTR 中有字符串,我想使用 W2CA (WideCharToMultiByte) 对其进行转换:
USES_CONVERSION;
std::string myMBS = W2CA(myBSTR); // myBSTR is BSTR
但是当字符串非常大时 - 它会在这一行抛出异常“StackOverFlowException”。
但是当我使用这个时:
std::wstring myWide(myBSTR);
std::string myMBS(myWide.begin(), myWide.end());
我工作正常。 任何人都可以帮助解决这种行为吗?
更新:对于大字符串,我的意思是大约 10MB 的字符串。
【问题讨论】:
标签: c++ string typeconverter bstr