Communicating with MSVC++ via COM: how?

Mark Hammond mhammond at
Sat Jan 10 23:17:28 CET 2004

Eric Brunel wrote:
> This script doesn't work: the call to docs.CloseAll fails with the error:
> Traceback (most recent call last):
>   File "", line 13, in ?
>     docs.CloseAll()
> TypeError: object of type 'int' is not callable

This is because docs.CloseAll is making the call, and returning an int. 
  This, docs.CloseAll() is attempting to call that int.

It looks very much like you have no makepy support for MSVC built.

Just after the line:
app = win32com.client.Dispatch('MSDev.Application')
Try adding:
app = win32com.client.gencache.EnsureDispatch(app)

That should force makepy, and everything should start working.


More information about the Python-list mailing list