1.BSTR转CString
BSTR bstr;
CString cstr;
cstr = (LPCTSTR)bstr;
2.Cstring 转BSTR
CString cstr = _T("abcd");
BSTR bstr;
bstr = cstr.AllocSysString();
......
::SysFreeString(bstr);
3.int 转 CString
int i =0; Cstring s;
s.Format(_T("%d"),i);
4.CString转int
CString s;
int t = _wtoi(s); // unicode 函数相当于 ANSI 里的函数atoi