COM MakePy utility in PythonWin

Gerson Kurz gerson.kurz at t-online.de
Sun Sep 2 03:58:36 EDT 2001


On Sun, 02 Sep 2001 05:09:43 GMT, "Maan Hamze" <mmhamze at pleiades.net>
wrote:

>1.  In addition to using the excellent Lemburg's mxODBC, I have been using
>DAO to connect to Access using Jet engine, and using ADO too.  Of course the
>last two depend on using Hammond's COM clients in PythonWin.
>I am just curious though as to the advantages of using the COM MakePy
>utility.
>Hope someone can give some hints as to what does it do exactly.
One reason to do this is, that you otherwise have to manually define
keywords for constants defined in TLB files. If you use Makepy, you
can access all constants defined by the office objects using

win32com.client.constants.<name>

For example, to get the default contacts folder from Outlook, you can
write

f = mapi.GetDefaultFolder(win32com.client.constants.olFolderContacts)

provided you've make-pyed before.

>2.  I have a povray modelling program that offers a COM interface.  I was
>able to connect to it through Hammond's Python win32com.  But the interface
>itself is not listed in the COM browser in PythonWin.  I looked for it in
>the registry and found it and tried it in PythonWin and it worked.  I am
>just wondering why the object did not appear in the COM Broswer?

- do you implement IDispatch ? COM alone (eg. IUnknown + custom
derived interface) isn't enough to be usable in Python (or VB).

- Do you have the .tlb properly registered ?





More information about the Python-list mailing list