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
|
/*
* Errors.c
*
* Contains error messages for WINCAP
*
* These error messages all have constants associated with
* them, contained in errors.h.
*
* Note that not all these messages are used in WINCAP.
*
* Copyright (c) 1991 Microsoft Corporation. All rights reserved.
*/
#include <windows.h>
#include "errors.h"
extern char szAppName[];
static char *szErrors[] =
{
"Not a DIB file!",
"Couldn't allocate memory!",
"Error reading file!",
"Error locking memory!",
"Error opening file!",
"Error creating palette!",
"Error getting a DC!",
"Error creating Device Dependent Bitmap",
"StretchBlt() failed!",
"StretchDIBits() failed!",
"SetDIBitsToDevice() failed!",
"Printer: StartDoc failed!",
"Printing: GetModuleHandle() couldn't find GDI!",
"Printer: SetAbortProc failed!",
"Printer: StartPage failed!",
"Printer: NEWFRAME failed!",
"Printer: EndPage failed!",
"Printer: EndDoc failed!",
"SetDIBits() failed!",
"File Not Found!",
"Invalid Handle",
"General Error on call to DIB function"
};
void DIBError(int ErrNo)
{
if ((ErrNo < ERR_MIN) || (ErrNo >= ERR_MAX))
MessageBox(NULL, "Undefined Error!", szAppName, MB_OK | MB_ICONHAND);
else
MessageBox(NULL, szErrors[ErrNo], szAppName, MB_OK | MB_ICONHAND);
}
|