shithub: choc

Download patch

ref: 45359954fe5054f27637962a272177d9c8115b90
parent: cd07b206fa4e7ffa30aa1ef2e8e138603171fc9e
author: Simon Howard <[email protected]>
date: Sat Jun 6 22:10:21 EDT 2009

Use MessageBoxW instead of MessageBox (doesn't exist on Windows CE)

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1563

--- a/src/i_system.c
+++ b/src/i_system.c
@@ -246,6 +246,7 @@
     // On Windows, pop up a dialog box with the error message.
     {
         char msgbuf[512];
+        wchar_t wmsgbuf[512];
 
         va_start(argptr, error);
         memset(msgbuf, 0, sizeof(msgbuf));
@@ -252,7 +253,11 @@
         vsnprintf(msgbuf, sizeof(msgbuf) - 1, error, argptr);
         va_end(argptr);
 
-        MessageBox(NULL, msgbuf, "Error", MB_OK);
+        MultiByteToWideChar(CP_ACP, 0,
+                            msgbuf, strlen(msgbuf) + 1,
+                            wmsgbuf, sizeof(wmsgbuf));
+
+        MessageBoxW(NULL, wmsgbuf, L"Error", MB_OK);
     }
 #endif