From: Vadim Zeitlin Date: Tue, 13 Jan 2009 22:53:49 +0000 (+0000) Subject: use wxWindow::GetClientSize() instead of ::GetClientRect() in wxActiveXContainer... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0641c71271b8b6ce77296c3156efacf7dd064049?ds=sidebyside use wxWindow::GetClientSize() instead of ::GetClientRect() in wxActiveXContainer::CreateActiveX() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58086 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/ole/activex.cpp b/src/msw/ole/activex.cpp index eb05f85bb6..58a4c2bf68 100644 --- a/src/msw/ole/activex.cpp +++ b/src/msw/ole/activex.cpp @@ -1017,9 +1017,6 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) m_oleObject->SetClientSite(m_clientSite); - RECT posRect; - ::GetClientRect((HWND)m_realparent->GetHWND(), &posRect); - m_oleObjectHWND = 0; if (m_oleInPlaceObject.Ok()) @@ -1032,9 +1029,14 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) if (! (dwMiscStatus & OLEMISC_INVISIBLEATRUNTIME)) { + RECT posRect; + wxCopyRectToRECT(m_realparent->GetClientSize(), posRect); + if (posRect.right > 0 && posRect.bottom > 0 && m_oleInPlaceObject.Ok()) - m_oleInPlaceObject->SetObjectRects(&posRect, &posRect); + { + m_oleInPlaceObject->SetObjectRects(&posRect, &posRect); + } hret = m_oleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, NULL, m_clientSite, 0, (HWND)m_realparent->GetHWND(), &posRect);