why did wxpython MakeActiveXclass stopped working?!?!!?!?

jojoba jojoba12 at hotmail.com
Sun Aug 6 13:10:50 EDT 2006


HI
I wrote a little wxpython program with an embedded windows media
player.
It worked great. Recently, I reinstalled windows and then wxpython
(most likely a newer version than i had before). Now when i run the
exact same code, i get this error:

  File "C:\Documents and
Settings\jojoba.DEMO-019591FB22\Desktop\Projects\SrAsse
ts\sr.py", line 353, in __init__
    self.CreateActiveXplayer()
  File "C:\Documents and
Settings\jojoba.DEMO-019591FB22\Desktop\Projects\SrAsse
ts\sr.py", line 363, in CreateActiveXplayer
    self.Player           = PlayerActiveXClass(self, -1)
  File
"C:\Python24\Lib\site-packages\wx-2.6-msw-ansi\wx\lib\activexwrapper.py",
 line 108, in axw__init__
    (0, 0, sz.width, sz.height), self._wnd, ID)
  File "C:\Python24\Lib\site-packages\pythonwin\pywin\mfc\activex.py",
line 23,
in CreateControl
    self.__dict__["_obj_"] = win32ui.CreateControl(clsid, windowTitle,
style, re
ct, parent, id, None, False, lic_string)
win32ui: The window can not be created as it has an invalid handle


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=wxCLIP_CHILDREN|wxNO_FULL_REPAINT_ON_RESIZE)
        self.MixMaster = parent
        self.ID3data   = {}
        self.InitWindowProperties()
        self.CreateActiveXplayer()

    def InitWindowProperties(self):
        self.WindowsMediaPlayerTopSizer = wxBoxSizer(wxVERTICAL)
        self.SetSizer(self.WindowsMediaPlayerTopSizer)
        self.SetAutoLayout(1)

    def CreateActiveXplayer(self):
        PlayerModule          =
win32com.client.gencache.EnsureModule('{6BF52A50-394A-11D3-B153-00C04F79FAA6}',
0,1,0)
        PlayerActiveXClass    =
MakeActiveXClass(PlayerModule.WindowsMediaPlayer, eventObj = self)
        self.Player           = PlayerActiveXClass(self, -1)
        self.Player.isPlaying = 0
        self.Player.uiMode    = 'full'
        self.WindowsMediaPlayerTopSizer.Add(self.Player, 1, wxEXPAND)


Any ideas anyone...i have reinstalled wxpython to no avail....Please
help anyone....
thanks,
jojoba




More information about the Python-list mailing list