diff options
author | Darkvater <Darkvater@openttd.org> | 2007-01-18 14:06:30 +0000 |
---|---|---|
committer | Darkvater <Darkvater@openttd.org> | 2007-01-18 14:06:30 +0000 |
commit | 4dd029a393987bd2fb1ebe16d5c3698e56ccb236 (patch) | |
tree | 8696903fb72bff5bc050ac9f888098c2543322f1 /src/win32.cpp | |
parent | f0e463eccaeee1262b57466f67d7736017a79bfd (diff) | |
download | openttd-4dd029a393987bd2fb1ebe16d5c3698e56ccb236.tar.xz |
(svn r8239) -Regression (r7278): Help window was empty for UNICODE builds
Diffstat (limited to 'src/win32.cpp')
-rw-r--r-- | src/win32.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/win32.cpp b/src/win32.cpp index 82611513e..018d5c8c2 100644 --- a/src/win32.cpp +++ b/src/win32.cpp @@ -371,7 +371,7 @@ static INT_PTR CALLBACK CrashDialogFunc(HWND wnd,UINT msg,WPARAM wParam,LPARAM l case WM_INITDIALOG: { #if defined(UNICODE) /* We need to put the crash-log in a seperate buffer because the default - * buffer in MB_TO_WIDE is not large enough (256 chars) */ + * buffer in MB_TO_WIDE is not large enough (512 chars) */ wchar_t crash_msgW[8096]; #endif SetDlgItemText(wnd, 10, _crash_desc); @@ -841,12 +841,16 @@ void ShowInfo(const char *str) fprintf(stderr, "%s\n", str); } else { bool old; - +#if defined(UNICODE) + /* We need to put the text in a seperate buffer because the default + * buffer in MB_TO_WIDE might not be large enough (512 chars) */ + wchar_t help_msgW[4096]; +#endif ReleaseCapture(); _left_button_clicked =_left_button_down = false; old = MyShowCursor(true); - if (MessageBox(GetActiveWindow(), MB_TO_WIDE(str), _T("OpenTTD"), MB_ICONINFORMATION | MB_OKCANCEL) == IDCANCEL) { + if (MessageBox(GetActiveWindow(), MB_TO_WIDE_BUFFER(str, help_msgW, lengthof(help_msgW)), _T("OpenTTD"), MB_ICONINFORMATION | MB_OKCANCEL) == IDCANCEL) { CreateConsole(); } MyShowCursor(old); |