From 1ac2bd895df0f15a6a7493408dead83064a443bb Mon Sep 17 00:00:00 2001 From: The Dax Date: Mon, 26 Aug 2013 13:20:58 -0400 Subject: [PATCH] Windows build fix. --- file/dialog.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/file/dialog.cpp b/file/dialog.cpp index 70864cc3e7..0cffd2f834 100644 --- a/file/dialog.cpp +++ b/file/dialog.cpp @@ -8,18 +8,18 @@ // For desktop operating systems only. Stubbed out on Android. // Simplified as this will only be used in utilities / temp code. // An false returned means cancel; -bool OpenFileDialog(const char *title, const char *extension, std::string *filename) +bool OpenFileDialog(const wchar_t *title, const wchar_t *extension, std::wstring *filename) { OPENFILENAME of; memset(&of, 0, sizeof(of)); - char buffer[512] = {0}; + wchar_t buffer[512] = {0}; of.lStructSize = sizeof(OPENFILENAME); of.hInstance = 0; of.hwndOwner = GetActiveWindow(); // These weird strings with zeroes in them can't be dealt with using normal string // functions, so here we go - evil hackery. - char filter[256] = "XXX files\0*.XXX\0\0"; + wchar_t filter[256] = L"XXX files\0*.XXX\0\0"; memcpy(filter, extension, 3); memcpy(filter + 12, extension, 3); of.lpstrFilter = filter; @@ -34,18 +34,18 @@ bool OpenFileDialog(const char *title, const char *extension, std::string *filen return true; } -bool SaveFileDialog(const char *title, const char *extension, std::string *filename) +bool SaveFileDialog(const wchar_t *title, const wchar_t *extension, std::wstring *filename) { OPENFILENAME of; memset(&of, 0, sizeof(of)); - char buffer[512] = {0}; + wchar_t buffer[512] = {0}; of.lStructSize = sizeof(OPENFILENAME); of.hInstance = 0; of.hwndOwner = GetActiveWindow(); // These weird strings with zeroes in them can't be dealt with using normal string // functions, so here we go - evil hackery. - char filter[256] = "XXX files\0*.XXX\0\0"; + wchar_t filter[256] = L"XXX files\0*.XXX\0\0"; memcpy(filter, extension, 3); memcpy(filter + 12, extension, 3); of.lpstrFilter = filter;