谢了~

解决方案 »

  1.   

    CWnd::MessageBox()当然是这样
    还有一个API,MessageBox(),四个参数的,都可以用。
      

  2.   

    凡是派生于CWnd的类都能用,其他的不可以,可以用全局的AfxMessageBox
      

  3.   

    CWnd::MessageBox
    int MessageBox( LPCTSTR lpszText, LPCTSTR lpszCaption = NULL, UINT nType = MB_OK );Return ValueSpecifies the outcome of the function. It is 0 if there is not enough memory to create the message box.ParameterslpszTextPoints to a CString object or null-terminated string containing the message to be displayed.lpszCaptionPoints to a CString object or null-terminated string to be used for the message-box caption. If lpszCaption is NULL, the default caption “Error” is used.nTypeSpecifies the contents and behavior of the message box.
    MessageBox
    The MessageBox function creates, displays, and operates a message box. The message box contains an application-defined message and title, plus any combination of predefined icons and push buttons. int MessageBox(
      HWND hWnd,          // handle of owner window
      LPCTSTR lpText,     // address of text in message box
      LPCTSTR lpCaption,  // address of title of message box
      UINT uType          // style of message box
    );
     
    Parameters
    hWnd 
    Identifies the owner window of the message box to be created. If this parameter is NULL, the message box has no owner window. 
    lpText 
    Pointer to a null-terminated string containing the message to be displayed. 
    lpCaption 
    Pointer to a null-terminated string used for the dialog box title. If this parameter is NULL, the default title Error is used. 
    uType 
    Specifies a set of bit flags that determine the contents and behavior of the dialog box. This parameter can be a combination of flags from the following groups of flags.
      

  4.   

    AfxMessageBox()和 MessageBox()区别是什么?
      

  5.   

    都可用,在非窗口类中使用时将第一个参数传入NULL就行了