summaryrefslogtreecommitdiff
path: root/src/wincap/errors.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wincap/errors.c')
-rw-r--r--src/wincap/errors.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/wincap/errors.c b/src/wincap/errors.c
new file mode 100644
index 0000000..c038450
--- /dev/null
+++ b/src/wincap/errors.c
@@ -0,0 +1,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);
+}