torsten's .NET blog In the end, everything is a gag [Ch. Chaplin]
# Tuesday, October 14, 2003
User Sample

Posted my piece of code to embed the IE WebBrowser control in .NET without wrapping DLL's [.NET] as a GDN User Sample In general it is a rework of the code posted here, but with some extensions I needed and without saving static html to temporary file to navigate to later. The crux of matter is how to define the correct Interop for IHTMLDocument2.Write().
Here is my working solution:

using System;
using System.Runtime.InteropServices;

namespace System.Windows.Forms.Html {
  [InterfaceType(ComInterfaceType.InterfaceIsDual), ComVisible(true),   Guid(@"332C4425-26CB-11D0-B483-00C04FD90119")]
  interface IHTMLDocument2 {
    ...     
    ///

    
    /// Write complete html doc content including markup.
    ///
    /// object[] containing the string(s)
    ///
    ///
    /// IHTMLDocument2 document = control.GetDocument();
    /// if (document != null) {
    /// document.Open("", null, null, null);
    /// object[] a = new object[]{"Hello world"};
    /// document.Write(a);
    /// document.Close();
    /// }
    ///
    ///

    void Write(
      [In, MarshalAs(UnmanagedType.SafeArray)] object[] psarray);
    ...
  }
}

May be there is an Interop Guy that is able to solve it in a more elegant way? Currently IJW. This functionality is covered by the control itself. Usage of that feature of IE Control looks like this:

htmlControl.Html = myHtmlString;
htmlControl.Navigate(null);

With this approach you will also get the NavigateXYZ() events to listen for further usage.

Technorati tags:  | 
Tuesday, October 14, 2003 8:26:12 PM (W. Europe Daylight Time, UTC+02:00)    #  Comments [3]  | 
Sunday, June 03, 2007 1:32:43 PM (W. Europe Daylight Time, UTC+02:00)
Hi, I am wondering if you could answer my question.
I am using a modified version of RSS Bandit(changes done by others), and we are currently facing the following problem, the htmlDetail control doesn't display the summary of the selected RSS item, I have debugged the system and found that everything is working correctly, even the html is handed correctly to the HTMl property for the IE Control but oddly it doesn't display it.
Here is the line of code in the MainGui.cs file:
htmlDetail.HTML = (call to the formatting function);
htmlDetail.Navigate(null);

I have got a workaround by using the code you have mentioned in your post earlier:

IHTMLDocument2 doc = htmlDetail.Document2;
doc.open("",null,null,null);
doc.write(new object[]{html});
doc.close();

And it will work and show the html.
Can you think of anything that will prevent the IE Control from displaying its HTML content?

Thank you for having the time to read this.

Best Regards.
Mustafa
Monday, June 11, 2007 8:48:53 AM (W. Europe Daylight Time, UTC+02:00)
You can find a more up-to-date version of the IEControl in our RSS Bandit project at sourceforge: http://dev.rssbandit.org. You should try that one.
TorstenR
Monday, September 10, 2007 9:32:02 PM (W. Europe Daylight Time, UTC+02:00)
I switched to RSSBandit after NewsGator and Outlook started having performance problems with the number of feeds that I was trying to process each day.
Comments are closed.
Navigation

Like RSS Bandit? Make a donation to help support its development and maintenance. As little as 1€ will help.

Make payments with PayPal - it's fast, free and secure!
Site supporters
On this page....
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910

SUBSCRIBE RSS GeoURL e-mail

Search
Categories
Blogroll

newtelligence dasBlog 2.3.9074.18820

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Join WebHost4Life.com