By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,552 Members | 927 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,552 IT Pros & Developers. It's quick & easy.

IHtmlDocument TroubleShooting

P: n/a
I am trying to debug my application which is a web scrapping application. I randomly get error will my code is processing web pages. For example I get this error:

An unhandled exception of type 'System.Runtime.InteropServices.COMException'
occurred in
WebClient.exe

Additional information: Exception from HRESULT: 0xC0000005.

I am using HttpWebReponse/Request to retrieve html documents so I load them into an IhtmlDocument2 by using the following declaration and then code:
Dim myDoc As mshtml.IHTMLDocument2 = New mshtml.HTMLDocument
myDoc.close()
myDoc.open("about:blank")
'write the HTML to the document using the MSHTML "write" method...
Dim clsHTML() As Object = {pHTML}
myDoc.write(clsHTML)
clsHTML = Nothing

It has been previously suggested that processing shouldn't continue with the document until it is completely loaded. I know the status of an IhtmlDocument2 can be obtained by viewing the ..IHTMLDocument2.readyState. When I view my code through the debugger the ready state changes from loading to interactive after I write content to the html but it never changes to complete. Does anyone know why this would be and what I should add to my code to fix this problem.

Thank you in advance,
Curtis

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Curtis

We have a complete sample for this on our website.

http://www.windowsformsdatagridhelp....f-56dbb63fdf1c

I hope this helps,

Cor
Nov 21 '05 #2

P: n/a
Thanks for the example Cor but I already have my app built I am just trying
to figure out why it randomly gives me the error I mentioned in my previous
post. Any help as to why that errror might occur would be greatly
apperciated.

Thanks,
Curtis

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:e6**************@TK2MSFTNGP09.phx.gbl...
Curtis

We have a complete sample for this on our website.

http://www.windowsformsdatagridhelp....f-56dbb63fdf1c

I hope this helps,

Cor

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.