From 3d5ffba1a183bbe3d930158e87f65f858b78559c Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Mon, 3 Aug 2009 17:18:44 +0200 Subject: Fix compile error on WinCE. Reviewed-by: TrustMe --- src/activeqt/container/qaxwidget.cpp | 4 ++++ src/activeqt/control/qaxserverbase.cpp | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp index 19f00db..ff6bcb8 100644 --- a/src/activeqt/container/qaxwidget.cpp +++ b/src/activeqt/container/qaxwidget.cpp @@ -985,7 +985,11 @@ HRESULT WINAPI QAxClientSite::TranslateAccelerator(LPMSG lpMsg, DWORD /*grfModif bool ActiveQtDetected = false; bool fromInProcServer = false; +#ifdef GWLP_USERDATA LONG_PTR serverType = GetWindowLongPtr(lpMsg->hwnd, GWLP_USERDATA); +#else + LONG serverType = GetWindowLong(lpMsg->hwnd, GWL_USERDATA); +#endif if (serverType == QAX_INPROC_SERVER) { ActiveQtDetected = true; fromInProcServer = true; diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp index e482c60..e7ddb47 100644 --- a/src/activeqt/control/qaxserverbase.cpp +++ b/src/activeqt/control/qaxserverbase.cpp @@ -3605,15 +3605,26 @@ HRESULT WINAPI QAxServerBase::TranslateAcceleratorW(MSG *pMsg) return S_FALSE; bool resetUserData = false; // set server type in the user-data of the window. +#ifdef GWLP_USERDATA LONG_PTR serverType = QAX_INPROC_SERVER; +#else + LONG serverType = QAX_INPROC_SERVER; +#endif if (qAxOutProcServer) serverType = QAX_OUTPROC_SERVER; +#ifdef GWLP_USERDATA LONG_PTR oldData = SetWindowLongPtr(pMsg->hwnd, GWLP_USERDATA, serverType); +#else + LONG oldData = SetWindowLong(pMsg->hwnd, GWL_USERDATA, serverType); +#endif HRESULT hres = controlSite->TranslateAcceleratorW(pMsg, dwKeyMod); controlSite->Release(); // reset the user-data for the window. +#ifdef GWLP_USERDATA SetWindowLongPtr(pMsg->hwnd, GWLP_USERDATA, oldData); - +#else + SetWindowLong(pMsg->hwnd, GWL_USERDATA, oldData); +#endif return hres; } -- cgit v0.12