[python-win32] Can win32com handle this one?
David Abrahams
dave at boost-consulting.com
Wed Feb 6 21:45:05 CET 2008
on Mon Feb 04 2008, "Mark Hammond" <mhammond-AT-skippinet.com.au> wrote:
>> >
>> > 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.
>
> Oops - it looks like I should have written:
>
> ob =
> win32com.client.Dispatch(s.GetProvider().QueryInterface(pythoncom.IID_IDispa
> tch))
>
>>
>> So I guess I need to resort to wrapping the C++ API into an extension
>> module.
>
> Or look at 'comtypes', which may end up being less work than an extension
> module.
Seems to handle the problem very nicely, thank you!
Is there somewhere a summary of criteria by which I'd choose win32com or
comtypes?
--
Dave Abrahams
Boost Consulting
http://boost-consulting.com
More information about the python-win32
mailing list