#pragma hdrstop
#endif
-//---------------------------------------------------------------------------
-// MediaCtrl include
-//---------------------------------------------------------------------------
+#if wxUSE_MEDIACTRL && wxUSE_ACTIVEX
+
#include "wx/mediactrl.h"
-//---------------------------------------------------------------------------
-// Compilation guard
-//---------------------------------------------------------------------------
-#if wxUSE_MEDIACTRL
+#ifndef WX_PRECOMP
+ #include "wx/log.h"
+#endif
-//---------------------------------------------------------------------------
-// WX Includes
-//---------------------------------------------------------------------------
-#include "wx/log.h" // wxLogDebug
#include "wx/msw/private.h" // user info and wndproc setting/getting
#include "wx/msw/ole/activex.h" // wxActiveXContainer - COM-specific stuff
wxSize m_bestSize; // Actual movie size
bool m_bWasStateChanged; // See the "introduction"
+ wxEvtHandler* m_evthandler;
friend class wxWMP10MediaEvtHandler;
DECLARE_DYNAMIC_CLASS(wxWMP10MediaBackend)
m_pWMPPlayer(NULL)
{
+ m_evthandler = NULL;
}
//---------------------------------------------------------------------------
m_pAX->DissociateHandle();
delete m_pAX;
- m_ctrl->PopEventHandler(true);
+ if (m_evthandler)
+ {
+ m_ctrl->RemoveEventHandler(m_evthandler);
+ delete m_evthandler;
+ }
#else
AtlAxWinTerm();
_Module.Term();
m_pAX = new wxActiveXContainer(ctrl, IID_IWMPPlayer, m_pWMPPlayer);
// Connect for events
- m_ctrl->PushEventHandler(new wxWMP10MediaEvtHandler(this));
+ m_evthandler = new wxWMP10MediaEvtHandler(this);
+ m_ctrl->PushEventHandler(m_evthandler);
#else
_Module.Init(NULL, ::GetModuleHandle(NULL));
AtlAxWinInit();
#endif // WMP mobile 9 hacks
-//---------------------------------------------------------------------------
-// End wxMediaCtrl Compilation Guard and this file
-//---------------------------------------------------------------------------
-#endif // wxUSE_MEDIACTRL
+#endif // wxUSE_MEDIACTRL && wxUSE_ACTIVEX