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