I am trying to replace the Windows.Forms.WebBrowser within a MDI WinForms application. I have the CefGlue code integrated with my application but the browser dialog doesn't load or render the document.
I began with the WinForms example in the distribution and got that working. Next, I built a minimal version of that as a separate solution, removing everything but the CefGlue; CefGlue.Demo; and CefGlue.Demo.Winforms assemblies. That works fine. I combined the CefGlue.Demo and CefGlue.Demo.Winforms assemblies into one and it runs, displaying the desired document. Finally I took the combined CefGlue.Demo and CefGlue.Demo.Winforms assemblies and added it into one of my UI assemblies as its own folder. Setting all the references and copying over all the .dlls and other files from the example solution bin directory seems to have got all the inclusions lined up.
Running my original applicaion combined with the CefGlue WinForms Demo intially got the error:
System.InvalidOperationException: Starting a second message loop on a single thread is not a valid operation. Use Form.ShowDialog instead.
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run()
at Xilium.CefGlue.Demo.DemoAppImpl.PlatformRunMessageLoop()
So I changed the DemoAppImpl.PlatformRunMessageLoop() call to ((MainViewImpl)_mainView).Show() (I need the browser to open in a modeless dialog to allow continued interaction with the main app or with the browser.) and moved the dispose and shutdown code into DemoApp's Quit() method. Everybody seemed happy.
When the CefGlue code is run, the browser.LoadingStateChanged event handler gets called but no other handler defined within MainViewImpl's NewTab() gets called, not browser.AddressChanged, nor browser.TargetUrlChanged etc. The tab title is set correctly but the tab page's content stays empty white and the cursor just spins and spins. I have disabled the solution's Visual Studio Hosting process and after I changed that I started getting two more of my main app windows popping up.
cef.log:
...
[0211/075743:VERBOSE1:pref_proxy_config_tracker_impl.cc(148)] 06C46780: set chrome proxy config service to 06C46640
[0211/075743:VERBOSE1:pref_proxy_config_tracker_impl.cc(274)] 06C46780: Done pushing proxy to UpdateProxyConfig
[0211/075755:VERBOSE1:proxy_service.cc(1135)] Failed configuring with PAC script, falling-back to manual proxy servers.
...
Is this a proxy configuration issue as the log hints?
Is the message loop begun by the Form.Show call sufficient for starting the spawned browser dialog's messaging?
Should the CefGlue browser form code be part of the UI assembly or should it remain a separate executable?
Is there any example of a main form calling the CefGlue browser in a dialog (modal or modeless) ?
VS2010 Premium, .Net 3.5
Thanks for your help.
Steven