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

Brad Johnson Brad.Johnson at ballardtech.com
Mon Nov 10 20:31:48 CET 2008


Brad Johnson <Brad.Johnson <at> ballardtech.com> writes:

Just as a follow-up, this didn't even end up being a complete solution. With my
particular combination of type libraries in my application, I can't rely on the
gencache to hold the correct mapping in the mapCLSIDToClass dict for reasons
stated earlier.

I need to go find out which type library the coclass truly lives in and use the
structure in that particular genpy generated file to get to the correct class.

Even this solution is limited to dispatch interfaces that only point to a single
coclass in a given type library. Fortunately this is the case for us but
certainly isn't universal.

It is my opinion that the architecture is flawed, and that one cannot assume a
particular coclass given a dispatch pointer no matter what type information is
emitted. Unless that object implements IProvideClassInfo or IPersist, we cannot
infer which coclass we are dealing with from a simple dispatch pointer.



More information about the python-win32 mailing list