[python-win32] Makepy does not generate all secondary interfaces?

Åsmund Hjulstad asmund.hjulstad at gmail.com
Tue Nov 9 18:44:40 CET 2010


After a some more struggling:

The reason why some files ended up in a subdirectory, was that I used
the gencache.EnsureDispatch call, which defaults to "on demand"
building of class interfaces. Not that it matters, though, I have the
same problem if I generate using makepy.py on the command line, or use
EnsureModule (that has a different default).

My latest attempt is

pisdkcommonlib = ('{76A44786-EBC8-11D3-BDC5-00C04F779EB2}', 0, 1, 0)
win32com.client.makepy.GenerateChildFromTypeLibSpec("IPIAsynchStatus2",
pisdkcommonlib, 1)

which gives me

Generating...
Building definitions from type library...
Building definitions from type library...
Building definitions from type library...
Building definitions from type library...
Generation complete..
Importing module

ImportError: No module named IPIAsynchStatus2

Any pointers appreciated. (Or is this possibly a bug?)


2010/11/9 Åsmund Hjulstad <asmund.hjulstad at gmail.com>:
> I am struggling with secondary interfaces and makepy
>
> I have generated an interface with makepy from a library ( PISDKCommon
> 1.0 Type Library ). It has an object, PIAsynchStatus, that exposes a
> secondary interface; IPIAsynchStatus2. I cannot find the secondary
> interface in the generated module, though. I wanted to do something
> like Mark Hammond suggested here:
> http://code.activestate.com/lists/python-list/27760/
>
> .. but without the secondary interface, I don't know how to do it.
>
> module = gencache.GetModuleForProgID('PISDKCommon.PIAsynchStatus')
> module.IPIAsynchStatus2   # Throws AttributeError
>
> Looking in the makepy-generated .py files, I find references to
> IPIAsynchStatus2 in the package's __init__.py file (everything from
> this library appears to end up in a subdirectory), but no class.
> The references are in the VTablesToPackageMap, NamesToIIDMap. The
> CLSIDToClassMap dict is empty.
>
> Any suggestions as to what can be wrong? Some secondary interfaces
> from a different, but related library appears in (another) module
> namespace without any problems. In this library, everything appears in
> one .py file, though, no subdirectory structure and __init__.py files.
>
>
> Åsmund Hjulstad
>



-- 
Åsmund Hjulstad, asmund at hjulstad.com


More information about the python-win32 mailing list