Call on specific thread

Having problems with building or using the CefGlue .NET/Mono binding? Ask your questions here.

Moderator: fddima

Re: Call on specific thread

Postby teremy » Wed Sep 07, 2016 9:10 pm

Here we go again.
It's funny how this thread is called "Call on specific thread", when it should be called "Call on specific process".
This time however the threads seem to be a problem.
I pretty much just want to use cefglue to be able to show html ( and manipulate it, to dynamically show a username for example ).
My networking stuff ( I mean my own networking stuff, that is using the lidgren network library, a network library written in C# ) is started in the browser process. But of course it runs on a different thread. When I make a call like Browser.GetMainFrame().LoadUrl("whatever.html"); it will cause an exception. I have correctly set a reference to the browser in the variable Browser. The different thread seems to be the problem.
It says: System.Reflection.TargetInvocationException: Exception has been thrown... blabla... System.ArgumentNullException: value cannot be null.
... at ....GetMainFrame()...

Or when I try Browser.SendProcessMessage it gives an error saying something about corrupt memory ( probably there is part of the memory where only a cef thread is allowed to read/write ).

I'm really thinking that cefglue might be the wrong solution for me. It's just to big of a project and extremely tedious to work with in my use case. I just want to show html sites and be able to manipulate it via C# code. I accepted the fact, that it uses multiple processes ( which in my use case makes it again very tedious to work with ). I'm used to work with an MVC like architecture, which is possible of course, but the renderer process can't for example register an event handler for my data model, since that is part of the browser process and the only thing the renderer can react to that stuff, is if I send it to it.

Any thoughts on the exceptions I get and the whining part at the end?
teremy
Techie
 
Posts: 15
Joined: Mon Aug 22, 2016 8:51 am

Re: Call on specific thread

Postby teremy » Thu Sep 08, 2016 1:09 am

It was my bad, I accidentally initialized my client ( my client that is using my networking stuff ) on the renderer process.
Now it works fine, though it's still not the best architecture imo.
Next thing I need are multiple windows that have different sites loaded. Better get to work :)
teremy
Techie
 
Posts: 15
Joined: Mon Aug 22, 2016 8:51 am

Previous

Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 14 guests