|
Rank: Newbie Groups: Member
Joined: 3/21/2015 Posts: 8
|
Hi
I've a windows form application using eo.webbrowser 2014, it has been compiled with vs2010 and vs2015 in windows 7 and window 8 and it works fine.
Now i updated to windows 10, downloaded eo.webbrowser 2015 and compiled with vs2015. I have this message : object reference not set to an instance of an object.
I tried to debug and inspect an instance of EO.WebBrowser.DOM.Window but this action restart visual studio.
I created a simple application but the result is the same.
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;
namespace Pruebas { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { EO.WebBrowser.DOM.Window win = new EO.WebBrowser.DOM.Window(); win = wv.GetDOMWindow(); string nHTML = win.document.body.innerHTML; } } }
when try to inspect win, visual studio restart.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, You definitely should not use "new EO.WebBrowser.DOM.Window()". The rest of your code is correct. If you still have problems, please try to send the test project to us and we will be happy to take a look. See here for more instructions on test application: http://www.essentialobjects.com/forum/test_project.aspxThanks!
|
|
Rank: Newbie Groups: Member
Joined: 3/21/2015 Posts: 8
|
Hi,
I change the code to
private string GetDocument() { object bodyObj = WebView.EvalScript("document.body"); EO.WebBrowser.DOM.Element body = EO.WebBrowser.JSObject.CastTo<EO.WebBrowser.DOM.Element>(bodyObj); return body.innerHTML; }
Now i have a document and i get a function and parameters.
This function download a file. Here it's the code:
//cmd has the function WebView.EvalScript(cmd); while (!Fin) { WebView.DoEvents(200); } It works the first time but takes a long, long time.
the second time send error: the request was canceled
Is thera a bug in eo.webbrowser ? The code was working Ok with version 2014.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
Please try to isolate the problem into a test app and send the test app to us. We will investigate further as soon as we receive that.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 3/21/2015 Posts: 8
|
Hi,
I send to you the proyect
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
We have looked into your test project. Please try to use an iframe instead of a link element to download a file. A link element can trigger a redirection in your main page, thus causing the content's of the main page to change. When this happens while you are looping through your Link element collections, the Element object your code holds on your .NET side would become invalid since the underlying DOM object has already been disposed (because the main page has been changed).
The debugger crashing issue should be a bug of VS 2015. The same behavior does not occur in VS 2013. Nevertheless, we are changing our code in the next build so that you will see a single "Value" property (instead of all other properties) of a JSObject. Watching JSObject in Visual Studio will not get the correct value since acquires values of those properties relies on other threads in the application. However VS would freeze all other threads while it evaluating a function/property. As such you will always get timeout errors when evaluating properties of a JSObject in VS's watch window (this is the behavior in 2013).
Thanks!
|
|