Using ActiveX Control from Python

Hirsch, John JohnH at PHM.GOV.AU
Sun Mar 18 20:22:54 EST 2001


Hi All
I am trying to use an ActiveX Control from Python 2.0 with little success.
The Interactive session goes a little like this.

First I ran AwusbIO ActiveX Control module through makepy.py -i.

>>> AwusbIO ActiveX Control module
 {95438942-F98A-11D2-AC25-00104B306BEE}, lcid=0, major=1, minor=0

   >>> # Use these commands in Python code to auto generate .py support

   >>> from win32com.client import gencache

   >>> gencache.EnsureModule('{95438942-F98A-11D2-AC25-00104B306BEE}', 0, 1,
0)

>>> from win32com.client import gencache

>>> gencache.EnsureModule('{95438942-F98A-11D2-AC25-00104B306BEE}', 0, 1, 0)
<module 'win32com.gen_py.95438942-F98A-11D2-AC25-00104B306BEEx0x1x0' from
'c:\python20\win32com\gen_py
\95438942-F98A-11D2-AC25-00104B306BEEx0x1x0.pyc'>

>>> aw = win32com.client.Dispatch("AWUSBIO.AwusbIOCtrl.1")

>>> aw
<win32com.gen_py.AwusbIO ActiveX Control module._DAwusbIO>

>>> aw.AboutBox
<method _DAwusbIO.AboutBox of _DAwusbIO instance at 01F5B38C>

>>> aw.AboutBox()
Traceback (innermost last):
  File "<interactive input>", line 1, in ?
  File
"c:\python20\win32com\gen_py\95438942-F98A-11D2-AC25-00104B306BEEx0x1x0.py",
line 29, in AboutBox
    return self._oleobj_.InvokeTypes(0xfffffdd8, LCID, 1, (24, 0), (),)
com_error: (-2147418113, 'Unexpected failure', None, None)
>>> 

I am running ActiveState ActivePython2.0 on Win98.
The Control works fine with the supplied demo software from ActiveWire (not
to be confused with ActiveState).
They provide a demo that runs the control in a web browser using Java
script.

Any suggestions?





More information about the Python-list mailing list