CHtmlView, the page source, and frames.

I have a CHtmlView application.  I would like to get the html source for a particular frame.

Ideally, it would work something like this:

CString html_source;
html_source = m_HtmlView->GetHtmlSource ();

Is this possible?   What are the steps necessary to get the html source for the frame?  Thanks.

Note that downloading it separately (with wininet for example) is not an option in this case.  The page in question requires the user to be "logged on".  When using WinInet, the server doesn't recongnize that I'm logged in and so gives me an error.
helpmealotAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
mikeblasConnect With a Mentor Commented:
One the page is laoded, query the document for IPeristStreamInit. Create a stream on some memory, and use the Write method in IPersistStreamInit to retrieve the source code.

See the revised HOLDER sample at http://www.nwlink.com/~mikeblas/samples/ for a working example of this method.

All my samples will soon move to someplace on www.mooseboy.com .

..B ekiM
0
 
helpmealotAuthor Commented:
Edited text of question.
0
 
mikeblasCommented:
Oh--and if you've got documents that have more than 1 frame, you'll need to get the document, query it for each individual frame, and then do the IPersistStorageInit trick against each frame.  IE considers each frame a separate entity.

..B ekiM
0
 
helpmealotAuthor Commented:
Excellent!  Your sample does exactly what I need.  Thanks!
0
All Courses

From novice to tech pro — start learning today.