/////////////////////////////////////////////////////////////////////////////
-// Name: msw/ole/activex.cpp
+// Name: src/msw/ole/activex.cpp
// Purpose: wxActiveXContainer implementation
// Author: Ryan Norton <wxprojects@comcast.net>, Lindsay Mathieson <???>
// Modified by:
#endif
#include "wx/dcclient.h"
+#include "wx/math.h"
#include "wx/msw/ole/activex.h"
//*************************IOleInPlaceSiteEx***********************
HRESULT STDMETHODCALLTYPE OnInPlaceActivateEx(BOOL * pfNoRedraw, DWORD)
{
+#ifdef __WXWINCE__
+ IRunnableObject* runnable = NULL;
+ HRESULT hr = QueryInterface(
+ IID_IRunnableObject, (void**)(& runnable));
+ if (SUCCEEDED(hr))
+ {
+ runnable->LockRunning(TRUE, FALSE);
+ }
+#else
OleLockRunning(m_window->m_ActiveX, TRUE, FALSE);
+#endif
if (pfNoRedraw)
(*pfNoRedraw) = FALSE;
return S_OK;
HRESULT STDMETHODCALLTYPE OnInPlaceDeactivateEx(BOOL)
{
+#ifdef __WXWINCE__
+ IRunnableObject* runnable = NULL;
+ HRESULT hr = QueryInterface(
+ IID_IRunnableObject, (void**)(& runnable));
+ if (SUCCEEDED(hr))
+ {
+ runnable->LockRunning(FALSE, FALSE);
+ }
+#else
OleLockRunning(m_window->m_ActiveX, FALSE, FALSE);
+#endif
return S_OK;
}
STDMETHOD(RequestUIActivate)(){ return S_OK;}
HRESULT STDMETHODCALLTYPE LockContainer(BOOL){return S_OK;}
//********************IOleItemContainer***************************
HRESULT STDMETHODCALLTYPE
- #ifdef _UNICODE
+ #if defined(__WXWINCE__)
+ GetObject
+ #elif defined(_UNICODE)
GetObjectW
#else
GetObjectA
};
#define HIMETRIC_INCH 2540
-#define CONVERT(x, logpixels) MulDiv(HIMETRIC_INCH, (x), (logpixels))
+#define CONVERT(x, logpixels) wxMulDivInt32(HIMETRIC_INCH, (x), (logpixels))
sz.cx = CONVERT(sz.cx, logX);
sz.cy = CONVERT(sz.cy, logY);
posRect.right = w;
posRect.bottom = h;
+#if defined(_WIN32_WCE) && _WIN32_WCE < 400
+ ::InvalidateRect(m_oleObjectHWND, NULL, false);
+#else
::RedrawWindow(m_oleObjectHWND, NULL, NULL, RDW_INTERNALPAINT);
+#endif
RECTL *prcBounds = (RECTL *) &posRect;
m_viewObject->Draw(DVASPECT_CONTENT, -1, NULL, NULL, NULL,
(HDC)dc.GetHDC(), prcBounds, NULL, NULL, 0);