CString 對象的 AllocSysString 方法將 CString 轉化成 BSTR:CString s;s = ... ; // whateverBSTR b = s.AllocSysString();