wxMediaCtrl CreateControl fails within dll

nukern at gmail.com nukern at gmail.com
Wed May 2 22:39:31 PDT 2007


Hi,

I have created a simple GUI app that uses wxMediaCtrl. It plays files
for both backends wxMEDIABACKEND_WMP10  and
wxMEDIABACKEND_DIRECTSHOW.

But if I move the wxMediaCtrl creation code to a dll and link it with
main GUI, the wxMediaCtrl->Create fails at CreateContorl(..),
specifically at this part of code
bool wxWMP10MediaBackend::CreateControl(wxControl* ctrl, wxWindow*
parent,
                                     wxWindowID id,
                                     const wxPoint& pos,
                                     const wxSize& size,
                                     long style,
                                     const wxValidator& validator,
                                     const wxString& name)
{
#ifndef WXTEST_ATL
    if( ::CoCreateInstance(CLSID_WMP10, NULL,
                                  CLSCTX_INPROC_SERVER,
                                  IID_IWMPPlayer,
(void**)&m_pWMPPlayer) != 0 )
    {
        if( ::CoCreateInstance(CLSID_WMP10ALT, NULL,
                                  CLSCTX_INPROC_SERVER,
                                  IID_IWMPPlayer,
(void**)&m_pWMPPlayer) != 0 )
            return false;

returning false. Why does this happen?

Thanks







More information about the wx-users mailing list