Further x86, x64 compatibility fix by reinterpret_cast<LONG_PTR> instead of reinterpret_cast<LONG> for SetWindowLongPtr

pull/129/head
Christian Grasser 10 years ago
parent 4d694ea704
commit 311c7d578e

@ -258,15 +258,15 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere)
//Use either Unicode or ANSI setwindowlong, depending on environment //Use either Unicode or ANSI setwindowlong, depending on environment
if (::IsWindowUnicode(_hSelf)) if (::IsWindowUnicode(_hSelf))
{ {
::SetWindowLongPtrW(_hSelf, GWLP_USERDATA, reinterpret_cast<LONG>(this)); ::SetWindowLongPtrW(_hSelf, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
_callWindowProc = CallWindowProcW; _callWindowProc = CallWindowProcW;
_scintillaDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtrW(_hSelf, GWLP_WNDPROC, reinterpret_cast<LONG>(scintillaStatic_Proc))); _scintillaDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtrW(_hSelf, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(scintillaStatic_Proc)));
} }
else else
{ {
::SetWindowLongPtrA(_hSelf, GWLP_USERDATA, reinterpret_cast<LONG>(this)); ::SetWindowLongPtrA(_hSelf, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
_callWindowProc = CallWindowProcA; _callWindowProc = CallWindowProcA;
_scintillaDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtrA(_hSelf, GWLP_WNDPROC, reinterpret_cast<LONG>(scintillaStatic_Proc))); _scintillaDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtrA(_hSelf, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(scintillaStatic_Proc)));
} }
//Get the startup document and make a buffer for it so it can be accessed like a file //Get the startup document and make a buffer for it so it can be accessed like a file

@ -440,8 +440,8 @@ BOOL CALLBACK ViewZoneDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara
case WM_INITDIALOG : case WM_INITDIALOG :
{ {
_viewZoneCanvas = ::GetDlgItem(_hSelf, IDC_VIEWZONECANVAS); _viewZoneCanvas = ::GetDlgItem(_hSelf, IDC_VIEWZONECANVAS);
::SetWindowLongPtrW(_viewZoneCanvas, GWLP_USERDATA, reinterpret_cast<LONG>(this)); ::SetWindowLongPtrW(_viewZoneCanvas, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
_canvasDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_viewZoneCanvas, GWLP_WNDPROC, reinterpret_cast<LONG>(canvasStaticProc))); _canvasDefaultProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtr(_viewZoneCanvas, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(canvasStaticProc)));
return TRUE; return TRUE;
} }

Loading…
Cancel
Save