MessageBox
CString str;
str.Format((L"result is %d"),bb);
::MessageBox(NULL,str,0,0);
Cstring
Cstring str;
str.Left(4) == "COM6"
str.Mid();
CString Mid( int nFirst, int nCount ) const;
nCount指明你要多少位。
//格式转换
TCHAR DeviceName[64];
COMMTIMEOUTS CommTimeOuts;
wsprintf(DeviceName,L"COM%d:",port);
CString ff= "123 ";
int i=atoi(ff.GetBuffer(10));
//c++
int num;
char cNum[32];
sprintf(cNum, "%d", num );
//获取长度
byte * Data;
int Length = sizeof(Data);
//宽字付定义
WCHAR key[8];
wcscpy(key, L"0000");