2 Replies - 419 Views - Last Post: 20 August 2009 - 05:15 PM Rate Topic: -----

#1 jjl  Icon User is offline

  • Engineer
  • member icon

Reputation: 1072
  • View blog
  • Posts: 4,532
  • Joined: 09-June 09

HTML from browser

Posted 20 August 2009 - 12:55 PM

I have a activex browser in my MFC dialog, but I need to extract some text from the HTML source. Does anyone know how to open a URL in a txt file?
thanks
Is This A Good Question/Topic? 0
  • +

Replies To: HTML from browser

#2 Mrafcho001  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 41
  • View blog
  • Posts: 769
  • Joined: 01-November 05

Re: HTML from browser

Posted 20 August 2009 - 04:31 PM

You mean like download the .HTML file from the server and then open to read it?

There is a function that will download files off the internet for you. I cant recall what it was called, but a quick google search should do it.

EDIT:
http://msdn.microsof...28VS.85%29.aspx

look at the WinINet Functions

This post has been edited by Mrafcho001: 20 August 2009 - 04:47 PM

Was This Post Helpful? 0
  • +
  • -

#3 jjl  Icon User is offline

  • Engineer
  • member icon

Reputation: 1072
  • View blog
  • Posts: 4,532
  • Joined: 09-June 09

Re: HTML from browser

Posted 20 August 2009 - 05:15 PM

I didnt need the html source code i just needed the contents with in the file, but if figured it out. For anyone who needs it, here the function i used.

void CHTMLDlg::getHtml()
{
	LPDISPATCH lpDispatch = NULL;
	IPersistFile *lpPersistFile = NULL;
	lpDispatch = c_browser.get_Document();
	lpDisspatch->QueryInterface(IID_IPersistFile,(void**)&lpPersistFile);
	lpPersistFile->Save(L"htmlfile.txt",0);
	lpPersistFile->Release();
	lpDispatch->Release();
}


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1