[python-win32] win32com and DispatchWithEvents()
mhammond at skippinet.com.au
Sat Nov 15 00:38:22 CET 2008
> haObj = win32com.client.DispatchWithEvents("HAWin32", HAEvents)
> It fails with the error message:
> "TypeError: This COM object can not automate the makepy process - please
> run makepy manually for this object"
At this point, all you need to do is execute makepy, then select the typelib
for your object. Once executed, you can then try the DispatchWithEvents
line again - there isn't a need to use EnsureModule yet.
If you *do* get that working, then you should try running "makepy.py -i" and
re-selecting the typelib - that will then spit out some 'EnsureModule' lines
you could use to automate the makepy process.
hrm - its quite possible that there are objects we can do events for, but
those objects do *not* provide typeinfo at runtime. We could probably
handle this situation, but unfortunately I'm not in a position to test
things. Ultimately, the message comes from a block in
raise TypeError("This COM object can not automate the makepy process -
please run makepy manually for this object")
It might be informative to remove that exception handler so we can see what
the original exception raised by the object was.
More information about the python-win32