Josh Steiner schrieb:
> Hello,
> 
> I'm working on a PyGtk project that runs only window and I need to embed 
> an ie IWebBrowser2 COM object into my app.  I found this:
> 
> http://www.daa.com.au/pipermail/pygtk/2005-June/010461.html
> 
> But that uses the ctypes.com module,  as far as I can tell comtypes 
> seems to be API incompatible, so my attempts to substitute it in place 
> failed. 
> 
> Is there a way to generate something like the ie6_gen.py from ctypes.com 
> with comtypes?
> 
> I'm totally new to windows specific Python coding, any help or pointers 
> would be greatly appreciated.

Usually, comtypes generates the wrappers automatically on demand.  The attached
script works for me; the needed magic is done by the (awfully named)
comtypes.client.wrap function.  This function queries the com object for the 
default
interface, which is IWebBrowser2 in this case.

On the other hand, if you want to generate the module 'manually', you do this by
calling comtypes.client.GetModule(<typelib-name>).  <typelib-name> for internet
explorer is "shdocvw.dll", the module is generated in the comtypes.gen package, 
in
this case as comtypes.gen.SHDocVw module.

Thomas

Attachment: ie_in_gtk.py
Description: application/python

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to