How to get an ActriveX control working in WX?

Alec Bennett whatyoulookin at yahoo.com
Mon Jan 28 03:05:57 PST 2008


I'm trying to use an ActiveX video capture DLL in WX. This is the module, if it matters:
http://www.elphotox.com/006.htm

Here's what I've gathered from a few hours of googling and futzing:

1) From within PythonWin I ran Tools --> Com MakePy Utility on the DLL to create a file called
C:\Python24\lib\site-packages\win32com\gen_py\16761F2C-934F-4851-8897-DC01F46253C8x0x1x0.py

2) I opened the file and got the CLSID out of it.

But when I run the code I get the following error:

Traceback (most recent call last):
  File "C:\Python24\newone.py", line 18, in ?
    Frame1(None)
  File "C:\Python24\newone.py", line 12, in __init__
    name="somename"
  File "C:\Python24\Lib\site-packages\wx-2.8-msw-unicode\wx\activex.py", line 226, in __init__
    _activex.ActiveXWindow_swiginit(self,_activex.new_ActiveXWindow(*args, **kwargs))
wx._core.PyAssertionError: C++ assertion "m_ActiveX.Ok()" failed at
contrib\activex\wxie/wxactivex.c
pp(323) in wxActiveX::CreateActiveX(): m_ActiveX.CreateInstance failed

Should I go the genaxmodule.py route? If so, can anyone point me in the direction of a good
tutorial? 

Here's the code I'm attempting to use with the ActiveX control now, which fails with the message
above:

import wx
import wx.activex as ActiveX

class Frame1(wx.Frame):
    def __init__(self, parent):

        wx.Frame.__init__(self, None , wx.ID_ANY, "Test")

        ctrl = wx.activex.ActiveXWindow(self,
                       clsId=wx.activex.CLSID('{16761F2C-934F-4851-8897-DC01F46253C8}'),
                       id=-1,
                       name="somename"
                       )        

        self.Show()

app = wx.App(redirect=0)
Frame1(None)
app.MainLoop()

Thanks hugely for any help.









      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 





More information about the wxpython-users mailing list