3 Error messages for fpTeX.
5 Copyright (C) 1998-2000 Free Software Foundation, Inc.
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
23 #include <kpathsea/config.h>
24 #include <kpathsea/c-proto.h>
25 #include <kpathsea/win32lib.h>
26 #include <kpathsea/lib.h>
27 #include <kpathsea/progname.h>
29 extern KPSEDLL char *kpathsea_version_string; /* from kpathsea/version.c */
32 Various messages to display error messages, either from Windows
36 /* Last error message in a MessageBox. */
37 void Win32Error(char *caller)
41 if (errCode = GetLastError()) {
43 FORMAT_MESSAGE_ALLOCATE_BUFFER
44 | FORMAT_MESSAGE_FROM_SYSTEM
45 | FORMAT_MESSAGE_IGNORE_INSERTS,
48 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
53 /* Display the string. */
54 MessageBox( NULL, lpMsgBuf, caller, MB_OK|MB_ICONINFORMATION );
55 /* Free the buffer. */
56 LocalFree( lpMsgBuf );
60 wsprintf(szBuf, "%d", errCode);
61 MessageBox( NULL, szBuf, caller, MB_OK|MB_ICONINFORMATION );
66 void Win32Msg(char *msg)
68 char *program = "(unknown)";
71 if (kpse_program_name && *kpse_program_name) {
72 program = kpse_program_name;
75 caller = concat3(program, "\r\n", kpathsea_version_string);
77 MessageBox(NULL, msg, caller, MB_OK|MB_ICONINFORMATION);