[wxPython-users] why did wxpython MakeActiveXclass stop working?!?!!?!?

Harald Blåtand kozneb at gmail.com
Mon Aug 7 13:20:25 PDT 2006


Hi,

Been using activexwrapper so long I've almost forgotten those parts of the
code.
Fiddled a little with your sample, and at least this runs (XP SP2, Python
2.4, wx 2.6).
Maybe it was a version thing (note prefix "wx." below).

H

------------------------

from wxPython.lib.activexwrapper import MakeActiveXClass
import win32com
from win32com import client
import wx

class wxWMPlayer(wx.Panel):
   def __init__(self, parent):
       wx.Panel.__init__(self, parent, -1, style=3D
wx.CLIP_CHILDREN|wx.NO_FULL_REPAINT_ON_RESIZE)
       self.MixMaster =3D parent
       self.ID3data   =3D {}
       self.CreateActiveXplayer()

   def CreateActiveXplayer(self):
       PlayerModule          =3D
win32com.client.gencache.EnsureModule('{6BF52A50-394A-11D3-B153-00C04F79FAA=
6}',
0,1,0)
       PlayerActiveXClass    =3D MakeActiveXClass(
PlayerModule.WindowsMediaPlayer, eventClass=3DNone, eventObj =3D self)
#        self.Player           =3D PlayerActiveXClass(self, -1)
       self.Player           =3D PlayerActiveXClass(self.MixMaster, -1)   #
Parent seemed important...

       s =3D wx.BoxSizer(wx.VERTICAL)
       s.Add(self.Player, 1, wx.EXPAND, 0)
       self.MixMaster.SetSizer(s)


class MyFrame(wx.Frame):
   def __init__(self, parent, title):
       wx.Frame.__init__(self, parent, -1, title)

app =3D wx.PySimpleApp()
f =3D MyFrame(None, "Player Test")
player =3D wxWMPlayer(f)
f.Show()
app.MainLoop()



On 8/7/06, matt sib <jojoba12 at hotmail.com> wrote:
>
>
> Here is a snippet from my code:
>
> from wxPython.lib.activexwrapper import MakeActiveXClass
> import win32com
> from win32com import client
>
> class wxWMPlayer(wxPanel):
>    def __init__(self, parent):
>        wxPanel.__init__(self, parent, -1,
> style=3DwxCLIP_CHILDREN|wxNO_FULL_REPAINT_ON_RESIZE)
>        self.MixMaster =3D parent
>        self.ID3data   =3D {}
>        self.InitWindowProperties()
>        self.CreateActiveXplayer()
>
>    def InitWindowProperties(self):
>        self.WindowsMediaPlayerTopSizer =3D wxBoxSizer(wxVERTICAL)
>        self.SetSizer(self.WindowsMediaPlayerTopSizer)
>        self.SetAutoLayout(1)
>
>    def CreateActiveXplayer(self):
>        PlayerModule          =3D
> win32com.client.gencache.EnsureModule
> ('{6BF52A50-394A-11D3-B153-00C04F79FAA6}',
> 0,1,0)
>        PlayerActiveXClass    =3D
> MakeActiveXClass(PlayerModule.WindowsMediaPlayer, eventObj =3D self)
>        self.Player           =3D PlayerActiveXClass(self, -1)
>        self.Player.isPlaying =3D 0
>        self.Player.uiMode    =3D 'full'
>        self.WindowsMediaPlayerTopSizer.Add(self.Player, 1, wxEXPAND)
>
> Any ideas anyone...i have reinstalled wxpython to no avail....Please
> help anyone....
> thanks,
> jojoba
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200608=
07/7a736a35/attachment.htm


More information about the wxpython-users mailing list