Windows build fix.

This commit is contained in:
The Dax committed 2013-08-26 13:20:58 -04:00
1 parent a038f612bd
commit 1ac2bd895d
1 file changed
+6 -6
+6 -6
View File
@@ -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;