MakeActiveXClass and MSHTML - 2 problems...

Peter Sparago psparago at yahoo.com
Thu Oct 7 01:11:42 CEST 2004


I figured out the answer to the first question. For anyone interested,
in order to perform the QueryInterface call, you must make the call on
the embedded "OLE" (COM) object of the ActiveXControl like so:

persist = self.editor._oleobj_.QueryInterface(pythoncom.IID_IPersistFile)
persist.Load(url)

I still need help with the second issue. Anyone?

psparago at yahoo.com (Peter Sparago) wrote in message news:<584da15e.0410051513.60b77760 at posting.google.com>...
> I have been mostly successful in embedding the Microsoft MSHTML editor
> in a python application. However, there are two issues that are
> driving me bananas.
> 
> Issue 1:
> I can't set focus to the editor control. Since the ActiveX wrapper
> extends wx.Window, if I do something like:
> 
> self.editor.SetFocus
> 
> it returns false. Has anyone been able to programmatically set focus
> to the MSHTML editor control?
> 
> Issue 2:
> I want to be able to query the IHTMLDocument object (interface) that
> MakeActiveXClass generates for the ICustomDoc interface (in order to
> take control of the right-click context menu). However, QueryInterface
> is NOT supported by the IHTMLDocument object (I did a dir(self.editor)
> to prove it - no QueryInterface). Has anyone queried the ActiveX
> object for another interface it implements?
> 
> Thanks
> peter



More information about the Python-list mailing list