Windows Develop Bookmark and Share   
 index > Windows Forms General > VB2008 webbrowser html vs. mshtml classes
 

VB2008 webbrowser html vs. mshtml classes

Using a webbrowser control in Visual Basic 2008 I notice that there are both html and mshtml object class references available. Mshtml seems to prove more object types (like mshtml.HTMLTableCol), but I get an IDE warning that "runtime errors are possible when converting from html to mshtml objects". Can anyone recommend resources to answer a couple of questions:

What are the advantages and disadvantages of using either of these classes in Visual Basic 2008 for automated data retrieval?

What is the best way for the class references to be declared and used in a VB project?

Thanks -Bgood

BGood  Thursday, April 10, 2008 6:08 PM

MSHTML Pro's

The mshtml library provides a powerful set of interfaces to extend HtmlDocuments and HtmlElements that fully implement the MSHTML DOM and the browsing model generally.

Some of the common interfaces include IHTMLDocument, IHTMLDocument2, IHTMLDocument3, IHTMLElement, IHTMLElement2, IHTMLElementCollection

MSHTML is ideal for editing and content manipulation and very easy to use.

MSHTML allows you to manipulate and access content using the HTML DOM standard (IHTMLDomNode etc)

MSHTML provides the ability to extend the document loaded to support features such a Edit Glyphs

MSHTML classes can be used to create custom browser controls, componentsand applications

MSHTML Con's

MSHTML is problematic in that it requires full trust to run.

MSHTML needs to be deployed with the solution to avoid problems

MSHTML will require you to Marshal __ComObjects where there is no managed type equivelent

MSHTML converts page content to a very basic and non standard format

Quick Summary

Although the Full Trust issue does bring with it obvious limitations, theMSHTML library is a valued asset, all other drawbacks can be challenged easily with robust solutions rather than workarounds.

Used in conjuction with custom XML parsers the possibilities are endless.

The managed Html objects would seem a wise choice for speed and simplicity and can be used extensively in similar applications as to those using MSHTML.

I will extend this outline when I have more time,

Steve

яeverser  Friday, April 11, 2008 5:33 AM

MSHTML Pro's

The mshtml library provides a powerful set of interfaces to extend HtmlDocuments and HtmlElements that fully implement the MSHTML DOM and the browsing model generally.

Some of the common interfaces include IHTMLDocument, IHTMLDocument2, IHTMLDocument3, IHTMLElement, IHTMLElement2, IHTMLElementCollection

MSHTML is ideal for editing and content manipulation and very easy to use.

MSHTML allows you to manipulate and access content using the HTML DOM standard (IHTMLDomNode etc)

MSHTML provides the ability to extend the document loaded to support features such a Edit Glyphs

MSHTML classes can be used to create custom browser controls, componentsand applications

MSHTML Con's

MSHTML is problematic in that it requires full trust to run.

MSHTML needs to be deployed with the solution to avoid problems

MSHTML will require you to Marshal __ComObjects where there is no managed type equivelent

MSHTML converts page content to a very basic and non standard format

Quick Summary

Although the Full Trust issue does bring with it obvious limitations, theMSHTML library is a valued asset, all other drawbacks can be challenged easily with robust solutions rather than workarounds.

Used in conjuction with custom XML parsers the possibilities are endless.

The managed Html objects would seem a wise choice for speed and simplicity and can be used extensively in similar applications as to those using MSHTML.

I will extend this outline when I have more time,

Steve

яeverser  Friday, April 11, 2008 5:33 AM

Wow. That was a comprehensive answer. Thanks, Steve.

  • Proposed As Answer byvborges3 Saturday, December 27, 2008 6:22 AM
  •  
BGood  Friday, April 11, 2008 1:31 PM
I did not find steves answer very helpfull, more on the lines of babbeling. Let's just say for the sake of argument that you were asking " In what way's do I utilize the same actions from the class within the new environment" Well, I see that he did not do anything but reitterate the basic class description of it's original terms. O.k. Steve, how about this - I want to use the webbrowser control as an HTML editor. I can create my whole document on the fly with code and to make it more interesting - I am using VB - How would I use the MSHTML object in order to insert table cells in an active document controlled from a windows form application??? $100.00 is the prize!
vborges3  Saturday, December 27, 2008 6:35 AM
I did not find steves answer very helpfull, more on the lines of babbeling. Let's just say for the sake of argument that you were asking " In what way's do I utilize the same actions from the class within the new environment" Well, I see that he did not do anything but reitterate the basic class description of it's original terms. O.k. Steve, how about this - I want to use the webbrowser control as an HTML editor. I can create my whole document on the fly with code and to make it more interesting - I am using VB - How would I use the MSHTML object in order to insert table cells in an active document controlled from a windows form application??? $100.00 is the prize!


LOL !!!! YOU WILL NEVER GET THIS ANSWERED WITH THE ATTITUDE THAT YOU DISPLAY IN THIS THREAD!!! LOL!!!
Inforequester123  Sunday, September 20, 2009 8:11 PM

MSHTML Pro's

The mshtml library provides a powerful set of interfaces to extend HtmlDocuments and HtmlElements that fully implement the MSHTML DOM and the browsing model generally.

Some of the common interfaces include IHTMLDocument, IHTMLDocument2, IHTMLDocument3, IHTMLElement, IHTMLElement2, IHTMLElementCollection

MSHTML is ideal for editing and content manipulation and very easy to use.

MSHTML allows you to manipulate and access content using the HTML DOM standard (IHTMLDomNode etc)

MSHTML provides the ability to extend the document loaded to support features such a Edit Glyphs

MSHTML classes can be used to create custom browser controls, componentsand applications

MSHTML Con's

MSHTML is problematic in that it requires full trust to run.

MSHTML needs to be deployed with the solution to avoid problems

MSHTML will require you to Marshal __ComObjects where there is no managed type equivelent

MSHTML converts page content to a very basic and non standard format

Quick Summary

Although the Full Trust issue does bring with it obvious limitations, theMSHTML library is a valued asset, all other drawbacks can be challenged easily with robust solutions rather than workarounds.

Used in conjuction with custom XML parsers the possibilities are endless.

The managed Html objects would seem a wise choice for speed and simplicity and can be used extensively in similar applications as to those using MSHTML.

I will extend this outline when I have more time,

Steve




Hey Steve,

I was wondering if you could assist on this inquiry since it seems that you may be able to:
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/8530c110-bc12-4ee1-ba9b-334f489a543e

Please take a look.

Thank you ! :)
Inforequester123  Sunday, September 20, 2009 8:12 PM

You can use google to search for other answers

Custom Search

More Threads

• StartupPath vs ExecutablePath
• SetAll class but readonly property missing ?
• custom format dates in MonthCalendar control
• Please tell me what "Smart Client" means.
• Highlight CheckedListBox Item
• Try catch standards
• .NET on Win32 on Win64
• Disable show pictures under WebBrowser Control
• How do I move the cursor on a dataTable ?
• background image distorts when i use the scroll bar on my panel