Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: 6 Aug 2005 07:00:31 -0700,    group: microsoft.public.inetsdk.programming.html_objmodel        back       


Accessing an IFrame's document.   
I am writing an test automation library in C# using mshtml.  All was
going well in testing the web application until I can to a page
containing an IFrame element.  I do not know how to access the Document
associated with the frame.  I can get the IHTMLFrameElement easily
enough,but I don't know how to change context to the frame's document.
I've multiple approaches such using contentWindow.document property but
I'm told theat the interface is not supported.

Any point me in the right direction?  I'm stumped...thx.

- Jimmo
date: 6 Aug 2005 07:00:31 -0700   author:   Jimmo

Re: Accessing an IFrame's document.   
Jimmo  wrote:
> I am writing an test automation library in C# using mshtml.  All was
> going well in testing the web application until I can to a page
> containing an IFrame element.  I do not know how to access the
> Document associated with the frame.  I can get the IHTMLFrameElement
> easily enough,but I don't know how to change context to the frame's
> document.

frames(frame-name-or-index).document;

"frames" collection contains "window" objects of each frame.

If you insist on going through IHTMLFrameElement, query it for 
IHTMLFrameBase2 and use contentWindow property.

> I've multiple approaches such using contentWindow.document
> property but I'm told theat the interface is not supported.

Should be supported as of IE5.5
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Mon, 8 Aug 2005 10:51:26 -0400   author:   Igor Tandetnik

Re: Accessing an IFrame's document.   
I'm sure it is supported.  I think the problem lies in the
Microsoft.mshtml.dll interop library shipped with Visual Studio 2003.
the contentWindow or contextDocument properties throw "Interface not
suppored" message.  The frames property returns a FrameCollection which
also fails....Driving me nuts.  I don't want to hack into the interop
library...
date: 8 Aug 2005 16:11:03 -0700   author:   Jimmo

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us