On Apr 16, 2:15 am, Matthew Brindley <[EMAIL PROTECTED]>
wrote:
> Hello,
>
> I'm embedding the Mozilla ActiveX Control in a .Net application, which
> is working very well so far. One limitation is the ability to retrieve
> an object that implements MSHTML.IHtmlWindow (or similar) from a frame
> element. At present, I can get the frame's element (the "IFRAME"
> element) which implements IHtmlElement, but I need it to also
> implement IHtmlFrameElement (or similar) to be able to get the
> contents of that frame.
>
> I'd like to have a go at implementing MSHTML's IHtmlDocument2's
> get_frames method in embedding/browser/activex/src/control/
> IEHtmlDocument.cpp.
>
> I've found the skeleton method:
>
> HRESULT STDMETHODCALLTYPE
> CIEHtmlDocument::get_frames(IHTMLFramesCollection2 __RPC_FAR
> *__RPC_FAR *p)
> {
> *p = NULL;
> return E_NOTIMPL;
>
> }
>
> Does anyone have any advice about where to begin? I'm new to XPCOM
> (and C++ for that matter) I've found various "GetFrames" methods
> within Gecko's source, some of which return a collection of DOMWindow
> objects, which seems promising. I'm hoping the existing
> nsIDOMHTMLDocument instance field within IEHtmlDocument will be enough
> to get access to a GetFrames method.
>
> Does this sound like the right way to go about it? If there's an
> easier way to get frames support in the ActiveX control, I'd be keen
> to hear it!
>
> Thanks,
>
> Matthew
First, Mozilla doesn't implement document.frames, it implements
window.frames - as does MSHTML IHTMLWindow2. So to implement
IHTMLDocument2.get_frames, you will likely need to use nsIDOMWindow,
not nsIDOMHTMLDocument.
I see nsIDOMWindow is accessible from here:
http://mxr.mozilla.org/seamonkey/source/embedding/browser/activex/src/control/MozillaBrowser.cpp#1745
CIEHTMLDocument holds a pointer the the CMozillaBrowser (mControl)
which you can use to then get the frames.
Mark Finkle
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding