473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

MHT/MSHTML displaying in the WebBrowser

Hi -

This issue seems to have been kicking around since the dawn of time and no
one appears to have come up with an answer.

In short the MHT/MSHTML provides a method of archiving an HTML page into a
single MIME encoded file that specifies all of the resources for a page in a
single file.

This makes a lot of sense as if you could pass one of these to the
WebBrowser.DocumentStream property then you could display a sensible HTML
document with images/css etc. all being resolved. They could also be stored
in resources or generated on the fly to display an HTML page. All well and
good.

The problem with specifying a document (HTML) to DocumentText or
DocumentStream is that external references on the page cannot easily be
provided (unless someone knows otherwise?). The only method of achieving
this is to write the file out to a temporary directory as disk based files
and then use WebBrowser.Navigate to display it.

The only way to get MHT/MSHTML files displayed correctly also appears to be
to write them to disk and then call WebBrowser.Navigate which seems crazy.
It appears that WebBrowser or MSHTML/SHDocView has the capability to display
them but it doesn't appear to be exposed (unless of course that they do
interally get written to disk?).

This doesn't make sense if you can generate the document in memory. You then
have to write it out to display it.

Various articles seem to state that by implementing the IPersistStreamInit
interface will resolve the problem. I have spent a fair amount of time
implementing the above interface along with IPersistStream/IStorage etc. to
see if they resolve the problem.

None of what I have tried to date has enabled me to display the files
correctly. They get rendered but all of the MIME information is shown on
screen as if it is HTML text and they look shocking.

I just wondered if anyone i) knows a solution to this problem and is willing
to share it, or ii) has any other ideas with regards to how to display them
as I must admit I'm running out of things to try?

Regards

- Andy
Jan 5 '07 #1
0 3545

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Charles Law | last post by:
Sorry for the cross post, but I'm not sure who is best placed to answer this one. This is the most bizarre behaviour of MSHTML and streams. I have a WebBrowser control that contains nothing...
7
by: Robert May | last post by:
I have an application that uses the Ax web browser object. When I call the IHTMLElement.click() method on an input button (<input type="submit"> or <input type="button">), the click fires...
0
by: John Bowman | last post by:
Hi, I've got a simple C# (.NET 1.1) app that will run only on Win2K and WinXP (min IE ver. 5.01) that uses the ax webbrowser control to display a simple hmtl page and disables the right click...
0
by: Giuseppe | last post by:
Hi I've this problem Inside a winform application I've put a "webbrowser" control I've tried to catch the oncontextmenu event of the loaded HTML document with the following approach 1) In...
7
by: Desmond Cassidy | last post by:
Hi, I have being trying to get a grip of HTML data manipulation and am using the mshtml class and System.Net to retriver HTML pages. Now as far as I can see, one can read HTML in different ways....
5
by: miktro | last post by:
I have an VB.Net desktop application where I am hosting a WebBrowser. I need to interact with the events in the browser. I encountered the normal problem of, after adding events the normal click...
0
by: Quantix | last post by:
I've been having a number of headaches trying to use the Webbrowser control and MSHTML to generate off screen images of webpages. I've got it working on a good number of sites, except the following...
0
by: Laurent Lequenne | last post by:
Hello All, I'm currently developing a free windows Scrabble (in french :)) application that uses extensively the WebBrowser class of NET 2.0 for configuration, and data browsing. It works 100%...
6
by: cellocoder | last post by:
I have tried it in Vb2005, vb2008, and CS2008. The program just hangs up with an hour glass. I downloaded a program with that reference added and it didn't work. I can add it to vb6 with no...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.