[PythonWin] MakePy and gencache.EnsureModule() do different things.

P

Paul Keating

I used MakePy to generate .py support for a COM dll. That created the
file

30D58DAF-B538-45F1-8EFF-F69ABA2BA798x0x1x13.py

I want to be sure that this file is present and so I used MakePy -i to
construct a call to gencache.EnsureModule().

This is what it said:

{30D58DAF-B538-45F1-8EFF-F69ABA2BA798}, lcid=0, major=1, minor=130, 1, 13)

But when I execute this code, it creates the support as a package,
that is, there is a _folder_ called

30D58DAF-B538-45F1-8EFF-F69ABA2BA798x0x1x19

(NB minor version is 19 not 13) with separate .py files for each
interface and class inside, and an __init__.py.

If the EnsureModule() call has not been called to generate the
package, then win32com.client.CastTo() fails when called with a
class-instance and interface defined in the COM dll. It complains that
it can't find the package ...x19.

Can anyone explain the version number difference (I realize that
19=0x13 but that doesn't help me understand it much), the
package/single file difference, and why Dispatch responds to the one,
but CastTo expects the other?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top