How to Navigate2 embedded resource

  • Thread starter Thread starter WRH
  • Start date Start date
W

WRH

Hello
I am using the Navigate2 method of the Microsoft Web Browser
control to display a local file, eg
....
object Zero = 0;
object url = "page1.htm";
axWebBrowser2.Navigate2(ref url, ref Zero,ref Zero,ref Zero,ref Zero);
....
Works fine. Now I want to make page1.htm an embedded resource
in my form Form1. How can I get the browser to navigate to an
embedded Resource?
 
This is a relatively complex task. You need to create an object that
implements the IStream interface and that provides the data required. This
can be handed to the IPeristStreamInit interface on the AXShDocVw browser
object's document such as...

doc = (IHTMLDocument2)this.axWebBrowser1.Document;

IPersistStreamInit psi=(IPersistStreamInit)doc;

psi.InitNew();

psi.Load((IStream)TheStream);


--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top