I am trying to concatenate two bstr_t one is char '#' and the other is an int (which I convert it to bstr_t) and gonna return it as a bstr (e.g '#'+'1234' as '#12345'). however, after concatenation the final result only contains '#'. I don't know where I am making mistake.
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();
}