Loading CEF into a DLL

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Loading CEF into a DLL

Postby JoeAndrieu » Wed Jun 10, 2009 8:05 pm

We are loading CEF into our own DLL, which is itself then loaded into Internet Explorer as an explorer bar (don't ask).

However, we are unable to get Chromium to display. We are replacing MSHTML, which displays just fine. Spy++ is able to see the CefBrowserWindow, but nothing is drawn on the screen.

We are using version 25 of CEF, on Windows XP SP2.

Unlike the cefclient app, we don't run our own message loop, so we call DoMessageLoopWork in a Timer handler. We've also tried initializing CEF as multi-threaded, but then CefBrowserWindow doesn't even show up in Spy++. We do see handler functions getting called, so we know the target page and related assets are being downloaded. However, nothing is painted on the screen, and no menu handling, keypresses, or other events are handled by the CEF window. Instead, any events propagate upward (as they should) to the explorer bar for the default IE handling (for right click menu handling for example). We have also tried multiple URLs, just in case the one we started with was crashing it.

Suggestions?

We are currently reconstructing this problem in a minimal IE toolbar (in case its leftover MSHTML cruft that is the problem). If that doesn't work we will try debugging from Chromium source. Any help would be appreciated.
JoeAndrieu
Techie
 
Posts: 21
Joined: Wed Jun 10, 2009 6:44 pm

Re: Loading CEF into a DLL

Postby magreenblatt » Thu Jun 11, 2009 8:38 am

You should upgrade to rev 27 as a number of issues have been fixed since rev 25. But, in any case, here are some possibilities to consider:

1. Are you passing the correct parent HWND and coordinates via the CefWindowInfo structure when creating the browser window? If necessary, are you resizing the browser window correctly when the parent window resizes?
2. When using the separate UI thread are you creating the browser window via CreateBrowser() and not CreateBrowserSync()? CreateBrowserSync() will not work with the separate UI thread.
3. When not using the separate UI thread are CEF events being starved because the timer does not fire often enough? You might want to try using the multimedia timer instead: http://msdn.microsoft.com/en-us/library/ms712713(VS.85).aspx
4. Is your parent class properly clipping child windows?

If possible you might also want to try loading your user interface outside of IE to verify that the basic approach you're using with CEF will work.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Loading CEF into a DLL

Postby JoeAndrieu » Thu Jun 11, 2009 4:41 pm

Thanks.

We now have CEF sort of working with a minimal toolbar. It renders and you can navigate as expected.

We are upgrading to v27 as we speak and trying the multi-threaded variant. We are still getting some errors with the rect and at shutdown. We're not sure what's causing that, but they are familiar from when we got MSHTML working originally, so they seem like fairly typical bugs to work through.

I'm not sure what the parent should be doing to clip. Doesn't CEF behave and stay inside the rect sent to it? If not, what do you mean by "properly clipping child windows"?
JoeAndrieu
Techie
 
Posts: 21
Joined: Wed Jun 10, 2009 6:44 pm

Re: Loading CEF into a DLL

Postby magreenblatt » Thu Jun 11, 2009 6:51 pm

CEF will stay inside the rect assigned to it (no promises about Flash or other plug-ins). The parent window WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles can have an effect on drawing if other windows exist that may be occluding the CEF window.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 56 guests