Partilhar via


CComControl::MessageBox

Call this method to create, display, and operate a message box.

int MessageBox(
   LPCTSTR lpszText,
   LPCTSTR lpszCaption = _T(""),
   UINT nType = MB_OK
);

Parameters

  • lpszText
    The text to be displayed in the message box.

  • lpszCaption
    The dialog box title. If NULL (the default), the title "Error" is used.

  • nType
    Specifies the contents and behavior of the dialog box. See the MessageBox entry in the Windows SDK documentation for a list of the different message boxes available. The default provides a simple OK button.

Return Value

Returns an integer value specifying one of the menu-item values listed under MessageBox in the Windows SDK documentation.

Remarks

MessageBox is useful both during development and as an easy way to display an error or warning message to the user.

Requirements

Header: atlctl.h

See Also

Reference

CComControl Class

Other Resources

CComControl Members