CString strErrorCode; int a = 33; float b = 7.5; strErrorCode.Format("%d,%f",a,b); AfxMessageBox((LPCTSTR)strErrorCode);