Question concerning makepy.py for COM (long, code included)

Mark Hammond mhammond at skippinet.com.au
Thu Feb 10 05:42:38 EST 2000


"Scott Anderson" <sanderson at ttm.com> wrote in message
news:38A1EE08.1550D3BF at ttm.com...
> mhammond at skippinet.com.au wrote:

> >
> > You dont need to do anything special - just call
> > "win32com.client.Dispatch(prog_id)" and it should work.
>
> That's dynamic dispatch. I was under the impression that makepy
> generated a Python module suitable for doing static dispatch...

Nope - once makepy is run, it is early-bound dispatch.
win32com.client.dynamic.Dispatch forces dispatch.

> From this page
> (http://www.python.org/windows/win32com/COMTutorial/img042.htm) I
had
> gotten the idea that I should just be able to do "o =
foo.TSHSWAPI()"
> (from the code I posted) and get a working object (this does not
work,
> hence my question).

That is a few years old now, and makepy is smarter.  Check out the
"conferences" link from my starship page and look for this years
conference, then find "late and early bound" references in that...

Or-just-buy-the-book-<wink>-ly,

Mark.






More information about the Python-list mailing list