Activate OLE ActiveX controls before requesting their window.
Change the order of IOkeInPlaceActiveObject::GetWindow() and DoVerb(OLEIVERB_INPLACEACTIVATE) calls and do the latter first now as otherwise GetWindow() returned NULL for standard ActiveX controls created by MFC. Closes #14209. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72027 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1110,16 +1110,20 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk)
|
||||
|
||||
m_oleObjectHWND = 0;
|
||||
|
||||
if (m_oleInPlaceObject.IsOk())
|
||||
{
|
||||
hret = m_oleInPlaceObject->GetWindow(&m_oleObjectHWND);
|
||||
if (SUCCEEDED(hret))
|
||||
::SetActiveWindow(m_oleObjectHWND);
|
||||
}
|
||||
|
||||
|
||||
if (! (dwMiscStatus & OLEMISC_INVISIBLEATRUNTIME))
|
||||
{
|
||||
hret = m_oleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, NULL,
|
||||
m_clientSite, 0, (HWND)m_realparent->GetHWND(), NULL);
|
||||
CHECK_HR(hret);
|
||||
|
||||
if (m_oleInPlaceObject.IsOk())
|
||||
{
|
||||
hret = m_oleInPlaceObject->GetWindow(&m_oleObjectHWND);
|
||||
CHECK_HR(hret);
|
||||
::SetActiveWindow(m_oleObjectHWND);
|
||||
}
|
||||
|
||||
RECT posRect;
|
||||
wxCopyRectToRECT(m_realparent->GetClientSize(), posRect);
|
||||
|
||||
@@ -1129,10 +1133,6 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk)
|
||||
m_oleInPlaceObject->SetObjectRects(&posRect, &posRect);
|
||||
}
|
||||
|
||||
hret = m_oleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, NULL,
|
||||
m_clientSite, 0, (HWND)m_realparent->GetHWND(), &posRect);
|
||||
CHECK_HR(hret);
|
||||
|
||||
hret = m_oleObject->DoVerb(OLEIVERB_SHOW, 0, m_clientSite, 0,
|
||||
(HWND)m_realparent->GetHWND(), &posRect);
|
||||
CHECK_HR(hret);
|
||||
|
Reference in New Issue
Block a user