[python-win32] Can win32com handle this one?

Mark Hammond mhammond at skippinet.com.au
Tue Feb 5 02:46:05 CET 2008


> >
> > 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.

Cheers,

Mark





More information about the python-win32 mailing list