1. MessageBox ("this is the simplest message box! "); 2. MessageBox (" this is a message box with a title! "," Title "); 3. MessageBox (" this is a message box to confirm cancellation! "," Title ", MB_OKCANCEL); 4. MessageBox (" this is a warning message box! "," Title ", MB_ICONEXCLAMATION); 5. MessageBox (" this is a message box with two attributes! "," Title ", MB_ICONEXCLAMATION | MB_OKCANCEL); 6.if( MessageBox (" a common application "," title ", MB_ICONEXCLAMATION | MB_OKCANCEL) = IDCANCEL) return; the default icons of other common attributes are attached. The message box displays the X errors MB_ICONHAND, MB_ICONSTOP, and MB_ICONERROR? Ask MB_ICONQUESTION! Warning MB_ICONEXCLAMATION and merge information in the form of the merge and MB_ICONINFORMATION buttons MB_ OK default MB_OKCANCEL determine whether to cancel MB_YESNO MB_YESNOCANCEL whether to cancel return value IDCANCEL unselect IDNO no selected IDOK confirm selected IDYES is selected supplement: the message box is used in the subclass of CWnd. If not, MessageBox (NULL, "ddd", "ddd", MB_ OK); or MessageBox (hWnd, "ddd", "ddd", MB_ OK); hWnd is the handle of a window, or AfxMessageBox is directly used. The attributes listed here are only some common attributes. In MSDN, there are more attributes: Visual C ++ 2005 compatibility error C2664: "CWnd: MessageBoxW ": parameter 1 cannot be converted from "const char [3]" to "LPCTSTR" error 2 error C2664: "inet_addr ": parameter 1 cannot be converted from "_ TCHAR *" to "const char *" d: \ vc program \ clienttcp. cpp 29 cause: 2005 the default "use Unicode Character Set" solves: in the properties of the project file of the solution you created, select "use multi-Byte Character Set" for "Character Set Configuration property. 2005 this error does not occur when you open a 6.0 file because the compiling environment is converted during the conversion process.