Sébastien Frippiat
unread,Jul 3, 2012, 4:06:16 AM7/3/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cef...@googlegroups.com
Hello.
I am trying to use cefglue in a WPF application but it doesn't seem to work for me: instead of the web content, I get a blank control.
Here is what I do:
- Create a WindowsFormHost control on my window
- In my window constructor, I create a new instance of CefWebBrowser (with a StartUrl) and assign it to the WindowsFormHost control Child property
When I display my form (which is not the main form: the form is opened through a context menu of a shell notify icon (in the lower right corner of the Windows taskbar), I get a window with a blank control in it and the control's mouse cursor is the smaller arrow with the small hourglass. It seems it doesn't get all the messages / events it requires. But I don't know what to do.
I noticed that if I change CefSettings.SingleProcess, it works, but the doc says it is not a very good idea to set it to true so I am not very keen on using that as a solution.
Here is my initialization code:
try
{
CefRuntime.Load();
}
catch (DllNotFoundException ex)
{
MessageBox.Show(ex.Message, "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
return 1;
}
catch (CefVersionMismatchException ex)
{
MessageBox.Show(ex.Message, "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
return 2;
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
return 3;
}
var cef_args = new CefMainArgs(new string[0]);
var cef_app = new KiClientCefApp();
var cef_exit_code = CefRuntime.ExecuteProcess(cef_args, cef_app);
if (cef_exit_code != -1)
return cef_exit_code;
var cef_settings = new CefSettings
{
SingleProcess = false,
MultiThreadedMessageLoop = true,
LogSeverity = CefLogSeverity.Info,
LogFile = Path.Combine(Path.GetDirectoryName(Log.LogFileName), "CefGlue.log")
};
Does anybody have an idea about that or at least a sample WPF application (C#) ?
Thanks,
Sebastien