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

This commit is contained in:
Christian Grasser 2015-05-27 22:47:40 +02:00
parent 4d694ea704
commit 311c7d578e
2 changed files with 6 additions and 6 deletions

View File

@ -258,15 +258,15 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere)
//Use either Unicode or ANSI setwindowlong, depending on environment
if (::IsWindowUnicode(_hSelf))
{
::SetWindowLongPtrW(_hSelf, GWLP_USERDATA, reinterpret_cast<LONG>(this));
::SetWindowLongPtrW(_hSelf, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
_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
{
::SetWindowLongPtrA(_hSelf, GWLP_USERDATA, reinterpret_cast<LONG>(this));
::SetWindowLongPtrA(_hSelf, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));
_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

View File

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