X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e4db172a3b318df9aff178eb6c5da149d56e0859..b50e6e416e2b4cdc849ea6f24181094c0957d904:/src/msw/mediactrl_wmp10.cpp diff --git a/src/msw/mediactrl_wmp10.cpp b/src/msw/mediactrl_wmp10.cpp index 2dc26fdbdf..01a10d5740 100644 --- a/src/msw/mediactrl_wmp10.cpp +++ b/src/msw/mediactrl_wmp10.cpp @@ -50,7 +50,7 @@ #pragma hdrstop #endif -#if wxUSE_MEDIACTRL +#if wxUSE_MEDIACTRL && wxUSE_ACTIVEX #include "wx/mediactrl.h" @@ -675,6 +675,7 @@ public: wxSize m_bestSize; // Actual movie size bool m_bWasStateChanged; // See the "introduction" + wxEvtHandler* m_evthandler; friend class wxWMP10MediaEvtHandler; DECLARE_DYNAMIC_CLASS(wxWMP10MediaBackend) @@ -699,7 +700,7 @@ public: private: wxWMP10MediaBackend *m_amb; - DECLARE_NO_COPY_CLASS(wxWMP10MediaEvtHandler) + wxDECLARE_NO_COPY_CLASS(wxWMP10MediaEvtHandler); }; #endif @@ -726,6 +727,7 @@ wxWMP10MediaBackend::wxWMP10MediaBackend() m_pWMPPlayer(NULL) { + m_evthandler = NULL; } //--------------------------------------------------------------------------- @@ -739,7 +741,11 @@ wxWMP10MediaBackend::~wxWMP10MediaBackend() 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(); @@ -812,7 +818,8 @@ bool wxWMP10MediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent, 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(); @@ -823,7 +830,7 @@ bool wxWMP10MediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent, ::GetClientRect((HWND)ctrl->GetHandle(), &rcClient); m_wndView.Create((HWND)ctrl->GetHandle(), rcClient, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE); hr = m_wndView.QueryHost(&spHost); - hr = spHost->CreateControl(CComBSTR(_T("{6BF52A52-394A-11d3-B153-00C04F79FAA6}")), m_wndView, 0); + hr = spHost->CreateControl(CComBSTR(wxT("{6BF52A52-394A-11d3-B153-00C04F79FAA6}")), m_wndView, 0); hr = m_wndView.QueryControl(&m_pWMPPlayer); if( m_pWMPPlayer->get_settings(&m_pWMPSettings) != 0) @@ -1470,7 +1477,7 @@ bool wxWinCEExecute(const wxString& path, int nShowStyle = SW_SHOWNORMAL) { WinStruct sei; sei.lpFile = path.c_str(); - sei.lpVerb = _T("open"); + sei.lpVerb = wxT("open"); sei.nShow = nShowStyle; ::ShellExecuteEx(&sei); @@ -1509,4 +1516,4 @@ bool MyApp::OnInit() #endif // WMP mobile 9 hacks -#endif // wxUSE_MEDIACTRL +#endif // wxUSE_MEDIACTRL && wxUSE_ACTIVEX