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.
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

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 for a working example of this method.

All my samples will soon move to someplace on .

..B ekiM
helpmealotAuthor Commented:
Edited text of question.
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
helpmealotAuthor Commented:
Excellent!  Your sample does exactly what I need.  Thanks!
All Courses

From novice to tech pro — start learning today.