summaryrefslogtreecommitdiffstats
path: root/private/nw/convert/nwconv/error.c
blob: d1bf87831fbf86e2cfaa2509e630d685635449d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
  +-------------------------------------------------------------------------+
  |                      Error Handling Routines                            |
  +-------------------------------------------------------------------------+
  |                     (c) Copyright 1993-1994                             |
  |                          Microsoft Corp.                                |
  |                        All rights reserved                              |
  |                                                                         |
  | Program               : [Error.c]                                       |
  | Programmer            : Arthur Hanson                                   |
  | Original Program Date : [Jul 27, 1993]                                  |
  | Last Update           : [Jun 18, 1994]                                  |
  |                                                                         |
  | Version:  1.00                                                          |
  |                                                                         |
  | Description:                                                            |
  |                                                                         |
  | History:                                                                |
  |   arth  Jun 18, 1994    1.00    Original Version.                       |
  |                                                                         |
  +-------------------------------------------------------------------------+
*/

#include "globals.h"


/*+-------------------------------------------------------------------------+
  | CriticalErrorExit()
  |
  |    This should only be called when there is an unrecoverable error and
  |    the program must abort (such as running out of disk space on main
  |    system or out of memory).
  |
  |    Can't dynamically load the error string (must do this at program
  |    init), because at time or error we might not be able to load it!
  |
  +-------------------------------------------------------------------------+*/
void CriticalErrorExit(LPTSTR ErrorString) {
   MessageBox(NULL, ErrorString, Lids(IDS_E_1), MB_ICONHAND | MB_SYSTEMMODAL | MB_OK);
   exit(0);

}  // CriticalErrorExit



/*+-------------------------------------------------------------------------+
  | WarningError()
  |
  |    Pops up a warning message to the user - this should only be used
  |    when the user must be notified of something (the program stops until
  |    the user responds), but it is not so critical the the program has to
  |    abort.
  |
  |    An example of this is if a config file is corrupt and the program
  |    will ignore it.
  |
  +-------------------------------------------------------------------------+*/
void WarningError(LPTSTR ErrorString, ...) {
   static TCHAR tmpStr[TMP_STR_LEN_256];
   va_list marker;

   va_start(marker, ErrorString);
   wvsprintf(tmpStr, ErrorString, marker);
   MessageBox(NULL, tmpStr, Lids(IDS_E_2), MB_ICONHAND | MB_OK);
   va_end(marker);

} // WarningError