X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c97d337bfe0482fe5f80588f2ba29446293b39e..25b3661bd4cb44304418b93c0dee1d0dfb99765c:/wxPython/contrib/activex/wxie/wxactivex.cpp?ds=sidebyside diff --git a/wxPython/contrib/activex/wxie/wxactivex.cpp b/wxPython/contrib/activex/wxie/wxactivex.cpp index 5e122af8b5..1fb0755413 100644 --- a/wxPython/contrib/activex/wxie/wxactivex.cpp +++ b/wxPython/contrib/activex/wxie/wxactivex.cpp @@ -317,10 +317,15 @@ void wxActiveX::CreateActiveX(REFCLSID clsid) wxCHECK_RET(adviseSink.Ok(), _T("adviseSink not Ok")); - // // Create Object, get IUnknown interface + // Create Object, get IUnknown interface m_ActiveX.CreateInstance(clsid, IID_IUnknown); wxCHECK_RET(m_ActiveX.Ok(), _T("m_ActiveX.CreateInstance failed")); + // Register object as active + unsigned long pdwRegister; + hret = RegisterActiveObject(m_ActiveX, clsid, ACTIVEOBJECT_WEAK, &pdwRegister); + WXOLE_WARN(hret, "Unable to register object as active"); + // Get Dispatch interface hret = m_Dispatch.QueryInterface(IID_IDispatch, m_ActiveX); WXOLE_WARN(hret, "Unable to get dispatch interface"); @@ -415,7 +420,7 @@ void wxActiveX::CreateActiveX(REFCLSID clsid) // Update by GBR to resize older controls wxSizeEvent szEvent; szEvent.m_size = wxSize(w, h) ; - AddPendingEvent(szEvent); + GetEventHandler()->AddPendingEvent(szEvent); }; } @@ -893,7 +898,7 @@ public: { // cdecl call // sometimes the pDispParams does not match the param info for a activex control - int nArg = min(func.params.size(), pDispParams->cArgs); + int nArg = wxMin(func.params.size(), pDispParams->cArgs); for (int i = nArg - 1; i >= 0; i--) { VARIANTARG& va = pDispParams->rgvarg[i]; @@ -908,8 +913,8 @@ public: if (func.hasOut) { - int nArg = min(func.params.size(), pDispParams->cArgs); - m_activeX->GetParent()->ProcessEvent(event); + int nArg = wxMin(func.params.size(), pDispParams->cArgs); + m_activeX->GetEventHandler()->ProcessEvent(event); for (int i = 0; i < nArg; i++) { VARIANTARG& va = pDispParams->rgvarg[i]; @@ -924,7 +929,7 @@ public: }; } else - m_activeX->GetParent()->AddPendingEvent(event); + m_activeX->GetEventHandler()->AddPendingEvent(event); };