home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / os2 / filedlg5 / errmsg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-26  |  7.6 KB  |  175 lines

  1. /****************************************************************************
  2.  * ERRMSG.H -- Header file containing the data structure and function       *
  3.  *             declarations of the standard error handler function.         *
  4.  *                                                                          *
  5.  *                                                                          *
  6.  *  Modifications --                                                        *
  7.  *      09-Oct-1989 : Initial version.                                      *
  8.  ****************************************************************************/
  9.  
  10. #pragma comment( lib,"errmsg.lib" )
  11.  
  12. /****************************************************************************
  13.  * Data type definitions                                                    *
  14.  ****************************************************************************/
  15.     typedef struct {
  16.         USHORT  usCode;         // error code
  17.         USHORT  flStyle;        // message box style (see explanation below)
  18.         PSZ     pszMsg;         // ptr to error message text
  19.         } ERRORMSG;
  20.  
  21.     typedef ERRORMSG FAR * PERRORMSG;
  22.  
  23. /****************************************************************************\
  24. flStyle     Specifies the type of message-box window created. This parameter
  25.             consists of a button flag, an icon flag, a default button flag,
  26.             and any number of special flags. The following four lists
  27.             describe the available flags which can be combined using the OR
  28.             operator together for this parameter:
  29.  
  30.             Buttons              Meaning
  31.             ----------------------------------------------------------------
  32.             MB_ABORTRETRYIGNORE  Message box contains Abort, Retry, and
  33.                                  Ignore push buttons.
  34.  
  35.             MB_ENTER             Message box contains an Enter push button.
  36.  
  37.             MB_ENTERCANCEL       Message box contains Enter and Cancel push
  38.                                  buttons.
  39.  
  40.             MB_OK                Message box contains an OK push button.
  41.  
  42.             MB_OKCANCEL          Message box contains OK and Cancel push
  43.                                  buttons.
  44.  
  45.             MB_RETRYCANCEL       Message box contains Retry and Cancel push
  46.                                  buttons.
  47.  
  48.             MB_YESNO             Message box contains Yes and No push
  49.                                  buttons.
  50.  
  51.             MB_YESNOCANCEL       Message box contains Yes, No, and Cancel
  52.                                  push buttons.
  53.  
  54.             Icon                Meaning
  55.             ----------------------------------------------------------------
  56.             MB_ICONASTERISK     Message box contains asterisk icon.
  57.  
  58.             MB_ICONEXCLAMATION  Message box contains exclamation-point
  59.                                 icon.
  60.  
  61.             MB_ICONHAND         Message box contains hand icon.
  62.  
  63.             MB_ICONQUESTION     Message box contains question-mark icon.
  64.  
  65.             MB_NOICON           Message box does not contain an icon.
  66.  
  67.             Default button  Meaning
  68.             ----------------------------------------------------------------
  69.             MB_DEFBUTTON1   First button is the default (first button is
  70.                             always the default unless MB_DEFBUTTON2 or
  71.                             MB_DEFBUTTON3 is specified).
  72.  
  73.             MB_DEFBUTTON2   Second button is the default.
  74.  
  75.             MB_DEFBUTTON3   Third button is the default.
  76.  
  77.             Special flags   Meaning
  78.             ----------------------------------------------------------------
  79.             MB_APPLMODAL    Message box is application modal.
  80.  
  81.             MB_SYSTEMMODAL  Message box is system modal.
  82.  
  83.             MB_HELP         Message box contains Help push button.
  84.  
  85.             MB_MOVEABLE     Message box is movable.
  86. \****************************************************************************/
  87.  
  88.  
  89. /****************************************************************************/
  90. extern USHORT cdecl far _loadds _export ErrMessageBox( HWND hwndOwner,
  91.                                                        PSZ pszCaption,
  92.                                                        USHORT usErrorCode,
  93.                                                        PERRORMSG perrormsg,
  94.                                                        USHORT cErrMsgCnt,
  95.                                                        ... );
  96. /****************************************************************************\
  97. The ErrMessageBox function creates, displays, and operates a message-box
  98. window that displays the error message associated with a given error
  99. code.
  100.  
  101. Parameters  Description
  102. ----------------------------------------------------------------------------
  103. hwndOwner   Identifies the owner window of the message-box window. The owner
  104.             window is activated when ErrMessageBox returns.
  105.  
  106. pszCaption  Points to the title of the message-box window. If this parameter
  107.             is NULL, "Error" (the default title) is displayed. The maximum
  108.             length of the text is device-dependent. If the text is too long,
  109.             it will be clipped.
  110.  
  111. usErrorCode Contains the error code.
  112.  
  113. perrormsg   Points to the user defined error message list. If this
  114.             parameter is NULL then the default system error message
  115.             list will be used.
  116.  
  117. cErrMsgCnt  Contains the number of items in the user defined error message
  118.             list. This parameter is ignored if perrormsg is NULL.
  119.  
  120. arguments   Optional list of arguments that are passed to the vsprintf
  121.             function in order to allow error messages to have variable
  122.             contents. NOTE THAT THIS FUNCTION REQUIRES THAT ALL POINTER
  123.             ARGUMENTS (SUCH AS POINTERS TO STRINGS) MUST BE FAR POINTERS.
  124.  
  125.  
  126. Return Value
  127.  
  128. The return value indicates the user's response to the message. It can be one
  129. of the following values:
  130.  
  131.     Value        Meaning
  132.     ------------------------------------------------------------------------
  133.     MBID_ABORT   Abort button was selected.
  134.  
  135.     MBID_CANCEL  Cancel button was selected.
  136.  
  137.     MBID_ENTER   Enter button was selected.
  138.  
  139.     MBID_IGNORE  Ignore button was selected.
  140.  
  141.     MBID_NO      No button was selected.
  142.  
  143.     MBID_OK      OK button was selected.
  144.  
  145.     MBID_RETRY   Retry button was selected.
  146.  
  147.     MBID_YES     Yes button was selected.
  148.  
  149.     MDID_ERROR   The WinMessageBox function failed--an error occurred.
  150.  
  151. If a message box has a Cancel button, MBID_CANCEL is returned if the ESCAPE
  152. key is pressed or if the Cancel button is selected. If the message box has
  153. no Cancel button, pressing the ESCAPE key has no effect.
  154.  
  155. Comments
  156.  
  157. If a message-box window is created as part of the processing of a dialog
  158. window, the dialog window should be made the owner of the message-box
  159. window.
  160.  
  161. If a system modal message-box window is created to tell the user that the
  162. system is running out of memory, the strings passed into this function
  163. should not be taken from a resource file because an attempt to load the
  164. resource file may fail due to lack of memory. Such a message-box window can
  165. safely use the hand icon (MB_ICONHAND), however, because this icon is always
  166. memory-resident.
  167.  
  168. If the message box contains a help pushbutton, the message box window
  169. identifier will be set to the error code value.
  170.  
  171. The total length of the error message string after it has been formatted
  172. and stored by vsprintf must not exceed 512 characters (including the
  173. terminating NULL character).
  174. \****************************************************************************/
  175.