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");