0
2つのbstr_tを連結しようとしていますが、もう1つはint型です(これをbstr_tに変換してbstr(例: '#') + '1234'を '#12345'とします)。ただし、連結後、最終結果には「#」のみが含まれます。私はどこで間違いをしているのか分かりません。2つのBstr文字列を連結するためのC++コード
function(BSTR* opbstrValue)
{
_bstr_t sepStr = SysAllocString(_T("#"));
wchar_t temp_str[20]; // we assume that the maximal string length for displaying int can be 10
itow_s(imgFrameIdentity.m_nFrameId, temp_str, 10);
BSTR secondStr = SysAllocString(temp_str);
_bstr_t secondCComStr;
secondCComStr.Attach(secondStr);
_bstr_t wholeStr = sepStr + secondCComStr;
*opbstrValue = wholeStr.Detach();
}