COM/Active X newbie question

Mark Hammond mhammond at skippinet.com.au
Fri Sep 6 23:23:54 EDT 2002


Gabe Gittings wrote:
> I am a newbie to prgramming in Python and programming under windows. I
> am trying to access an .ocx file. I can access the methods in python
> after running makePy.py but when I run a test script and try to access
> a method from the COM object I get this error.
> 
> Traceback (most recent call last):
>   File "<interactive input>", line 1, in ?
>   File "C:\Python22\Lib\site-packages\win32com\gen_py\7ADCDC5B-D0B6-11D1-AA76-002078136998x0x1x0.py",
> line 57, in GetRunManagerStatus
>     return self._oleobj_.InvokeTypes(0xa, LCID, 1, (8, 0), (),)
> com_error: (-2147418113, 'Catastrophic failure', None, None)
> 
If it is a true OCX, then it probably needs to be hosted in a GUI 
environment, such as pythonwin.  See pywin\demos\ocx for examples.

If you can find any VBScript or JScript code that works with the object, 
it should be usable the way you are trying.  If the only examples you 
can find are hosted inside a form in a full-blown VB sample, then the 
Pythonwin thang should work.

Mark.




More information about the Python-list mailing list