python and activeX control

vml victor.lebrun at gmail.com
Sat Apr 28 16:32:37 EDT 2007


I have an application that I want to automatised trough a COM layer or
(DCOM)...

I can access to all the method of the COM objects with python and
win32com when this application is running....

If the application is not running, I can not access to all the method
of the object.

Usually to overcome this problem , One can use an activeX control
which is just a bitmap in a form in VB(6)... and then the code is :

Dim module As Automation.IModule

Dim myBlock as Automation.IBlock2

Dim myDatabase As Automation.IDatabase

Set module = ActiveXModuleLoader1.module

myDatabase = module.Database("C:/Data/myproj")

I can have active X  ModuleLoader._DActiveXModuleLoader running under
python without a GUI but when you call the .module method of this
object it crashes.... :

Traceback (most recent call last):

  File "<interactive input>", line 1, in <module>

  File "D:\soft\python25\lib\site-packages\win32com\client
\__init__.py", line 458, in __getattr__

    return self._ApplyTypes_(*args)

  File "D:\soft\python25\lib\site-packages\win32com\client
\__init__.py", line 451, in _ApplyTypes_

    dispid, 0, wFlags, retType, argTypes, *args),

com_error: (-2147418113, 'Catastrophic failure', None, None)


my questions :

- Do you have ideas to do translate the vb code into python ?


-In a module genrated by makepy : what can I call as object : coclass
or Dipatch base class ?\


-Do you know how to integrate an activeX control in a python GUI
( wxpython ) ? WOuld it solve my problems ?


- Why I can not access all the method of an object when the
application is not running ? Is there a way to do it ?

-  can I create a Ghost of such an application to be able to have all
the method on all the objects ?

- Can I create a vb code which contains all the code for the com
objects and then try to use python with scipy to do some mathematical
operations on the data?

I would like to do every thing in python but I am a newbie ....

Thanks in advance !




More information about the Python-list mailing list