on Mon Feb 04 2008, Tim Roberts <timr-AT-probo.com> wrote:
> David Abrahams wrote:
>> 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.
>>
>
> Actually, you DO have an ILib2Provider object, wrapped in Python by
> PyIUnknown.
Well, I SHOULD have such an object, I know. The question is, of course,
how to retrieve it.
> You should be able to call the methods and properties of
> ILib2Provider using that object.
>
> Python doesn't know it's an ILib2Provider, because that's just a name
> used in the C++ source code, but the methods and properties should all
> be there.
They don't seem to be.
p.GetVersion()
gets me a traceback with an AttributeError. Any further ideas?
Even if we can make that work, it seems to me there oughta be a way to
get a Python ILib2Provider from this object, no?
--
Dave Abrahams
Boost Consulting
http://boost-consulting.com
_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32