[python-win32] Accessing other interfaces of a Dispatch created COM object

Mark Hammond mhammond at skippinet.com.au
Thu Sep 18 02:45:10 CEST 2008


> I've taken a look, and I can't say I had an "aha" moment, or anything
> like that, but perhaps I have learned something important.
> 
> Setting up the COM object seems very straightforward:
> 
> Type t = Type.GetTypeFromCLSID("{e04f970b-53ce-420a-86f8-
> 55374677703d}")
> 
> component = (basic.I1)Activator.CreateInstance(t)
> 
> component_2 = component as I2

Note that many compiled languages only need the typelib at compile time -
once built, they don't need the typelib to be installed and registered on
the target system.  This is in contrast to Python, where the typelib is
needed at runtime (unless makepy has been successfully run - the typelib is
then needed at makepy time - which is still at "runtime" unless py2exe etc
is involved).  Indeed, the typelib may not even need to be registered on the
build system - just a reference to it on disk by the build process would be
enough.

So - it still sounds to me that one of the 2 typelibs you rely on aren't
registered, and that your other compiled applications don't notice this.
Have you tried asking the people who supply the binaries you are using?

Mark



More information about the python-win32 mailing list