on Mon Feb 04 2008, "Mark Hammond" <mhammond-AT-skippinet.com.au> 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
>
> Unfortunately, win32com doesn't support arbitrary interfaces.  If the object
> you are using doesn't support IDispatch, then you can't use it from
> win32com.  You may like to try something like:
>
> ob = win32com.client.Dispatch(s.GetProvider())
>
> to see if it does support IDispatch, 

Hmm, thanks, I guess it doesn't:

     'PyIUnknown' object has no attribute 'GetTypeInfo'

> in which case you could then start calling methods etc on it.

So I guess I need to resort to wrapping the C++ API into an extension
module.

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

_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to