[python-win32] WIN32COM: Cannot get event interface given a wrapped dispatch pointer

Brad Johnson Brad.Johnson at ballardtech.com
Tue Nov 11 17:50:03 CET 2008


Mark Hammond <mhammond <at> skippinet.com.au> writes:

> 
> While you have obviously struck a bug, I need to understand it more before I
> can comment further.  I'll try and reproduce it using the C++ test object
> and IDL file - if you could help do that it would be greatly appreciated and
> help a timely solution.

I'd be happy to provide you more info for your test case. Please email me
directly if you have any questions for me. I'd spend more time isolating it
myself except that I have a workaround that works for me and work doesn't permit
me to do anything further unless on my own time.

> This is the crux of the problem and shouldn't be happening.  However, the
> gencache mechanism does allow for cross-module definitions - so there
> shouldn't be a problem if we ensure that each interface only appears exactly
> once in the gencache. 

I understand the gencache should be a composite of all the loaded IIDs/CLSIDs.
The problem appears to be a "last guy wins" where a new IID mapping will
overwrite the old (possibly correct) IID mapping when a new wrapper module is
created.

> Why do you say that?  If the typeinfo references an IID or CLSID, why can't
> we trust it?  In what scenario would it be incorrect?  It seems to be
> working well so far, not withstanding the bug which you say causes duplicate
> entries for the same interface.

Because the typeinfo does not emit any CLSID information as far as I can tell,
but rather the IID of the dispatch interface. Exemplified by this line

disp_clsid = ti.GetTypeAttr()[0]

This is the crux: The CLSID is not returned, which truly would be a one-to-one
mapping to a coclass, but rather the IID, which is one-to-many, though the map
only supports a single entry.





More information about the python-win32 mailing list