char buf[2] = {}; _itoa_s(12, buf, 16); std::string s = buf; CString str(s.c_str()); MessageBox(str);