编写com组件时,标准的字符串连接
STDMETHODIMP CFun::Cat(BSTR s1, BSTR s2, BSTR *pVal)
{
CComBSTR sResult( s1 );
sResult.AppendBSTR( s2 );
*pVal = sResult.Copy();
// *pVal = sResult.Detach();
return S_OK;
}
{
CComBSTR sResult( s1 );
sResult.AppendBSTR( s2 );
*pVal = sResult.Copy();
// *pVal = sResult.Detach();
return S_OK;
}