2

I am making a c# app that get a website I have and views it in the app. For this I am using OpenWebKitSharp to get the web view with HTML5. I followed all the instructions in the How-to-use.txt but, it runs with a popup saying it is not initialized and I should follow the How-to-use.txt. I am open to alternative as long as they can use HTML5.

My System:

  • Windows 10
  • Latest Visual Studio
  • Latest OpenWebKitSharp

using System;
using System.Windows.Forms;
using WebKit;

namespace Cosmic_Stocks
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            webKitBrowser1.UseJavaScript = true;

            Uri myUri = new Uri("http://cosmicsearch.org/stocks", UriKind.RelativeOrAbsolute);
            webKitBrowser1.Url = myUri;
        }
    }
}

The Popup:

The Popup Update:

Now there is a new error.

COMException was unhandled
AN unhandled exception of type 'system.runtime.interop.services.comexception' occored inopenwebkitsharp.dll

I got that when I was redoing the program

arodebaugh
  • 538
  • 1
  • 8
  • 26

1 Answers1

1

Following How to use.txt instructions worked just fine:

enter image description here

Notes:

  • Windows 10
  • VisualStudio 2015 Community Edition
  • .NET 4.5.2
  • OpenWebKitSharp 3.0.1.0023

When adding project References to OpenWebKitSharp.dll and WebKit.Interop.dll, both files were selected from the open-webkit-sharp\Binary folder.

The same OpenWebKitSharp.dll from the open-webkit-sharp\Binary folder was added to Tools -> Choose Toolbox Items...

All files and sub-folders under open-webkit-sharp\Core and open-webkit-sharp\References were copied under bin\Debug folder of the target project.

The very same code as in your post was used:

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        webKitBrowser1.UseJavaScript = true;

        Uri myUri = new Uri("http://cosmicsearch.org/stocks", UriKind.RelativeOrAbsolute);
        webKitBrowser1.Url = myUri;
    }
}
jsanalytics
  • 13,058
  • 4
  • 22
  • 43