Welcome Guest Search | Active Topics | Sign In | Register

Engine.Create() throws and exception Options
Oscar
Posted: Monday, November 16, 2015 12:16:21 PM
Rank: Member
Groups: Member

Joined: 11/12/2015
Posts: 10
Hi.

I am currently trying to use the engines but I found this problem:

Code: C#
Engine engine = Engine.Create("test");


This throws and exception: Object reference not set to an instance of an object.

Some ideas about what's going on?

Thanks in advance.
eo_support
Posted: Monday, November 16, 2015 2:05:06 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

This is a known issue. Please try to add the following code before Engine.Create:

Code: C#
WebView webView = new WebView();


Please let us know if this fixes the problem for you. This problem will be fixed in our next build so you will no longer need the above line by then.

Thanks!
Oscar
Posted: Monday, November 16, 2015 3:00:17 PM
Rank: Member
Groups: Member

Joined: 11/12/2015
Posts: 10
Thank you for the quick reply, it works :)
eo_support
Posted: Monday, November 16, 2015 4:10:24 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Great. Glad to hear that it works! Please feel free to let us know if you have any more questions.
Oscar
Posted: Tuesday, November 24, 2015 9:59:26 AM
Rank: Member
Groups: Member

Joined: 11/12/2015
Posts: 10
Hi again.

I am trying with the last version and now I get this exception:
Can not change engine when the WebView is already created.

Code: C#
Engine engine = Engine.Create(Guid.NewGuid().ToString());
_browser.Engine = engine;


How should I create the WebView?

Thanks.
eo_support
Posted: Tuesday, November 24, 2015 10:19:53 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

This is normal. The "engine assignment" is used when the WebView is created, which usually occurs when your Form or Window's window handle being created. So you must move the code before that. If you use Windows Forms, you can try to do inside your constructor after InitializeComponent and see if it works.

Thanks!
Oscar
Posted: Tuesday, November 24, 2015 12:25:50 PM
Rank: Member
Groups: Member

Joined: 11/12/2015
Posts: 10
Thanks for the response.
Oscar
Posted: Monday, November 30, 2015 6:51:28 AM
Rank: Member
Groups: Member

Joined: 11/12/2015
Posts: 10
Thanks again for the point, now is working like a charm.
eo_support
Posted: Monday, November 30, 2015 9:29:23 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Great. Thanks for confirming that it works!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.