Code sample for CefGlue

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

Moderator: fddima

Code sample for CefGlue

Postby molinch » Wed Aug 15, 2012 6:00 pm

Hi everybody,

I'm trying to use CefGlue in an existing application. The goal is to be able to use JS/SVG like in Chrome because we can't upgrade IE to a newer version.
Therefore each time I try to use the CefWebBrowser it always seems to create a new process which is another instance of the application. Furthermore the CefWebBrowser only gives me a blank page.

What I do is:
- I first initialize CEF using this code:
Code: Select all
CefRuntime.Load();

                var mainArgs = new CefMainArgs(new string[] { });
                var app = new ChromiumApp();
                var exitCode = CefRuntime.ExecuteProcess(mainArgs, app);
                if (exitCode != -1)
                    return; // FMT: throw exception??

                cefSettings = new CefSettings
                {
                    // BrowserSubprocessPath = @"D:\fddima\Projects\Xilium\Xilium.CefGlue\CefGlue.Demo\bin\Release\Xilium.CefGlue.Demo.exe",
                    SingleProcess = false,
                    MultiThreadedMessageLoop = true,
                    LogSeverity = CefLogSeverity.Disable,
                    LogFile = "CefGlue.log",
                };

                CefRuntime.Initialize(mainArgs, cefSettings, app);
                cefInitialized = true;

                if (!cefSettings.MultiThreadedMessageLoop)
                {
                    Application.Idle += OnApplicationIdle;
                }


- Then I instance CefWebBrowser and I add it to the Controls collection of the current form
- The new process seems to be created in CefWebBrowser.OnHandleCreated and then CefBrowserHost.CreateBrowser(windowInfo, client, settings, StartUrl);

Could you please tell me what I'm doing wrong?
I'm sure it's a stupid mistake.

Thanks in advance for your help!
Cheers,
Fabien
molinch
Newbie
 
Posts: 2
Joined: Wed Aug 15, 2012 5:52 pm

Re: Code sample for CefGlue

Postby fddima » Thu Aug 16, 2012 8:35 am

fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am


Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 9 guests