From 7c45b22d9d54a3c823f293ca5c87f281929ea032 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 28 Apr 2006 13:37:27 +0000 Subject: [PATCH] fix drag-and-drop with non-latin-1 chars in filename svn: r2835 --- src/wxwindow/src/msw/wx_win.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/wxwindow/src/msw/wx_win.cxx b/src/wxwindow/src/msw/wx_win.cxx index 0e7b14f268..f24b6abb2e 100644 --- a/src/wxwindow/src/msw/wx_win.cxx +++ b/src/wxwindow/src/msw/wx_win.cxx @@ -1593,21 +1593,24 @@ void wxWnd::OnDropFiles(WPARAM wParam) POINT dropPoint; WORD gwFilesDropped; char **files, *a_file; - int wIndex; + wchar_t *w_file; + int wIndex, len; DragQueryPoint(hFilesInfo, (LPPOINT) &dropPoint); // Get the total number of files dropped - gwFilesDropped = (WORD)DragQueryFile ((HDROP)hFilesInfo, - (UINT)-1, - (LPSTR)0, - (UINT)0); + gwFilesDropped = (WORD)DragQueryFile((HDROP)hFilesInfo, + (UINT)-1, + (LPSTR)0, + (UINT)0); files = new char *[gwFilesDropped]; for (wIndex=0; wIndex < (int)gwFilesDropped; wIndex++) { - DragQueryFile (hFilesInfo, wIndex, (LPSTR) wxBuffer, 1000); - a_file = copystring(wxBuffer); + len = DragQueryFileW(hFilesInfo, wIndex, NULL, 0); + w_file = new WXGC_ATOMIC wchar_t[len + 1]; + DragQueryFileW(hFilesInfo, wIndex, w_file, len); + a_file = wxNARROW_STRING(w_file); files[wIndex] = a_file; } DragFinish (hFilesInfo);