编写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;
}
posted @ 2011-03-23 12:44  银翼的魔术师  阅读(116)  评论(0编辑  收藏  举报