parent
2697bf5046
commit
432edf2101
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
#if defined(WIN32) // {
|
#if defined(WIN32) // {
|
||||||
|
|
||||||
|
#define NOMINMAX
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
void ErrorExit(const char *func_name)
|
void ErrorExit(const char *func_name)
|
||||||
|
@ -39,8 +40,8 @@ void ErrorExit(const char *func_name)
|
||||||
|
|
||||||
// Display the error message and exit the process
|
// Display the error message and exit the process
|
||||||
|
|
||||||
char mm[lstrlen((LPCTSTR)lpMsgBuf) + strlen(func_name) + 40];
|
char mm[256];
|
||||||
sprintf(mm, "%s failed with error %lu:\n%s", func_name, dw, (char*)lpMsgBuf);
|
snprintf(mm, sizeof(mm), "%s failed with error %lu:\n%s", func_name, dw, (char*)lpMsgBuf);
|
||||||
MessageBox(NULL, (LPCTSTR)mm, TEXT("Error"), MB_OK);
|
MessageBox(NULL, (LPCTSTR)mm, TEXT("Error"), MB_OK);
|
||||||
|
|
||||||
LocalFree(lpMsgBuf);
|
LocalFree(lpMsgBuf);
|
||||||
|
|
Loading…
Reference in New Issue