[python-win32] Can win32com handle this one?

David Abrahams dave at boost-consulting.com
Mon Feb 4 19:02:26 CET 2008


I have a couple of type libraries that I've run makepy on.

The first can be loaded with 

  s = win32com.client.Dispatch('nameof.Lib1')

I have verified that the above gets the ILib1Session object, which
the documentation for that library says is the entry point for
everything.

The documentation then states I'm to call the GetProvider method to get
an instance of ILib2Provider, which, naturally, is defined in Lib2.  The
GetProvider method is declared thus:

  HRESULT GetProvider (
   ILib2Provider   **ppProvider)

When I do 

  s.GetProvider() 

in Python, I get a PyIUnknown object.  No QueryInterface call I have
been able to manufacture will get me an ILib2Provider object.

Note also that trying

  win32com.client.Dispatch('nameof.Lib2')

produces a com_error ('No such interface supported')

I'm a total com n00b but am surprised to find myself stymied so quickly.
Can anyone help me get a little further with this?

Thanks in advance,

-- 
Dave Abrahams
Boost Consulting
http://boost-consulting.com



More information about the python-win32 mailing list