From 517d82a29a62933696291a448897d433616ea519 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Fri, 23 Sep 2016 00:13:49 +0200 Subject: [PATCH] Fix x64 crash on UDL dialg Fix x64 crash on new language dialog of UDL --- PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp | 6 +++--- PowerEditor/src/ScitillaComponent/UserDefineDialog.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp b/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp index c4f0b6b2c..66ee0cd4d 100644 --- a/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp +++ b/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp @@ -1301,7 +1301,7 @@ INT_PTR CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPAR else strDlg.init(_hInst, _hSelf, TEXT("Create New Language..."), TEXT("Name : "), TEXT(""), langNameLenMax-1); - TCHAR *tmpName = (TCHAR *)strDlg.doDialog(); + TCHAR *tmpName = reinterpret_cast(strDlg.doDialog()); if (tmpName && tmpName[0]) { @@ -1530,9 +1530,9 @@ INT_PTR CALLBACK StringDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) { TCHAR tmpName[langNameLenMax]; tmpName[0] = '\0'; - ::GetDlgItemText(_hSelf, IDC_STRING_EDIT, (LPTSTR)tmpName, langNameLenMax); + ::GetDlgItemText(_hSelf, IDC_STRING_EDIT, tmpName, langNameLenMax); _textValue = tmpName; - ::EndDialog(_hSelf, int(_textValue.c_str())); + ::EndDialog(_hSelf, reinterpret_cast(_textValue.c_str())); return TRUE; } diff --git a/PowerEditor/src/ScitillaComponent/UserDefineDialog.h b/PowerEditor/src/ScitillaComponent/UserDefineDialog.h index 822b5dddd..382626ad2 100644 --- a/PowerEditor/src/ScitillaComponent/UserDefineDialog.h +++ b/PowerEditor/src/ScitillaComponent/UserDefineDialog.h @@ -412,8 +412,8 @@ public : _txtLen = txtLen; }; - long doDialog() { - return long(::DialogBoxParam(_hInst, MAKEINTRESOURCE(IDD_STRING_DLG), _hParent, dlgProc, reinterpret_cast(this))); + INT_PTR doDialog() { + return ::DialogBoxParam(_hInst, MAKEINTRESOURCE(IDD_STRING_DLG), _hParent, dlgProc, reinterpret_cast(this)); }; virtual void destroy() {};