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

Philippe Martin pmartin at snakecard.com
Sun Aug 6 19:08:52 EDT 2006


jojoba wrote:

> Hi Phillipe!
> Thanks for the response!
> 
> Unfortunately, i have also reinstalled pywin32, and i still get the
> same error.
> 
> Isn't this weird?
> You know what else.
> 
> I have a py2exe version of this code, that actually runs fine, using
> the embedded windows media player. But Im guessing i made that py2exe
> distributable with older pywin32 and older wxpython.
> This makes me think that one of the newer versions of pywin32 or
> wxpython is giving me that error trouble.
> 
> Any other ideas on how to rectify this?
> Thanks again,
> jojoba
> 
> 
> Philippe Martin wrote:
>> Philippe Martin wrote:
>>
>> > jojoba wrote:
>> >
>> >> 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
>> >
>> >
>> > Did you reinstall pywin32 ?
>> > 
>> > Philippe
>> 
>> Well I'm silly: it would not import.

Hi,

I'd post this to wxPython-users at lists.wxwidgets.org

Philippe








More information about the Python-list mailing list