CString 对象的 AllocSysString 方法将 CString 转化成 BSTR

 CString 对象的 AllocSysString 方法将 CString 转化成 BSTR的方法:

CString s; 
s = "i love you";
BSTR b = s.AllocSysString();