pywin and wxPython

Ben Shapiro bshapiro at funnygarbage.com
Fri Feb 16 18:04:27 CET 2001


Hey all...
Here's the predicament..
I have an OCX control that is responsible for playback of mp3 files that i
am trying to
use from python.  This control is wrapped using makepy.  Mark H pointed me
in the right
direction to use pywin to host the OCX..  only problem is that my app uses
wxPython as the
GUI framework.  From what i can tell you need to attach the activex control
to an MFC window for
it to load....  Any example of how to do this would be appreciated greatly!

My existing code is below:

        p = win32ui.CreateWnd()
        win32ui.EnableControlContainer()
        mp3player =
gencache.EnsureModule('{2DF09BC5-B050-11D2-81C1-00C0DFEAA961}', 0, 1, 0)
        self.olectl = activex.MakeControlInstance(mp3player.AMPL3DLite)
        self.olectl.CreateControl("", win32con.WS_TABSTOP , (7,43,500,300),
p , 131)  <---- fails here  / nothing seems to happen if i comment out this
line
        self.olectl.Open("c:\\code\\3LP\\pyfileunder\\music\\test.mp3")
        self.olectl.Play()





More information about the Python-list mailing list