CEF3 in an activeX control

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.

CEF3 in an activeX control

Postby BadJerry » Tue Dec 04, 2012 11:43 am

Hello again Cefians,

I am trying to make CEF to work as an activeX control. I have had some (minor) successes with CEF1... but I have not been abe to successfully display a broswer, close it down and re-open it without subsequent crashes. I have even tried to unload the activeX after use ( by calling ::CoFreeUnusedLibraries() ) but that did not help.

I have read somewhere in the forum that if I need multiple browsers I would be better off with CEF3... being of a gullible and experimental nature, I have had a go. I have managed to display the browser but it freezes right away and spawns the same executable (which has the good taste of dying quickly).

Here is the code I am using:
Code: Select all
bool CMyChromiumControlApp::InitialiseChromium()
{
   CString strLocales(_T("C:\\ProgramData\\MyCtrl\\Locales"));

   CefSettings AppSettings;
   AppSettings.multi_threaded_message_loop = true;
   CefString(&AppSettings.locales_dir_path ) = (LPCTSTR) strLocales;


   // Initialize CEF.
#ifdef CEF3
   m_CefApp = new ClientApp;

   AppSettings.pack_loading_disabled = true;

   HINSTANCE hInstance = GetModuleHandle(NULL) ;
   CefMainArgs main_args(hInstance );
   bool bResult = CefInitialize(main_args,AppSettings, m_CefApp.get());
#else
   bool bResult = CefInitialize(AppSettings, m_CefApp);
#endif
   return bResult;
}

Clearly the way I call the constructor of CefMainArgs is to blame... but I am short of ideas.

Any tips on integrating Activex are welcome by the way... I know a few you of you have done it... and yes I'll share the code!

Regards
Jerry
BadJerry
Techie
 
Posts: 28
Joined: Fri Nov 02, 2012 7:32 am

Re: CEF3 in an activeX control

Postby magreenblatt » Tue Dec 04, 2012 11:49 am

magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CEF3 in an activeX control

Postby BadJerry » Tue Dec 04, 2012 12:11 pm

And now it makes sense - I had read this but never managed to understand... so I can use any executable that will run in the background to deal with the rendering!
Thanks for your quick and accurate response... and for not pointing out in a too obvious manner my stupidity!
BadJerry
Techie
 
Posts: 28
Joined: Fri Nov 02, 2012 7:32 am

Re: CEF3 in an activeX control

Postby BadJerry » Wed Dec 05, 2012 7:50 am

Damned now I need OnBeforeBrowse
I have seen it was meant to be in the next release... Is there a vague idea of when it's due?
I cannot believe I am asking a developper for a delivery date as my employers have given up doing that on me!

Thanks!
BadJerry
Techie
 
Posts: 28
Joined: Fri Nov 02, 2012 7:32 am

Re: CEF3 in an activeX control

Postby magreenblatt » Wed Dec 05, 2012 9:53 am

BadJerry wrote:Damned now I need OnBeforeBrowse
I have seen it was meant to be in the next release... Is there a vague idea of when it's due?
I cannot believe I am asking a developper for a delivery date as my employers have given up doing that on me!

Thanks!

Probably not until after the holidays. But you can build yourself by following the instructions @ http://code.google.com/p/chromiumembedd ... ndBuilding
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: CEF3 in an activeX control

Postby khalid80 » Sat Nov 12, 2016 9:59 am

any luck so far? I am trying to do the same to wrap Cef3 in activeX control to be used in Word,Excel.
khalid80
Newbie
 
Posts: 2
Joined: Sat Nov 12, 2016 9:39 am

Re: CEF3 in an activeX control

Postby BadJerry » Sun Nov 13, 2016 12:26 pm

I gave up - it was almost working... but I had crashes when creating a new control, when closing down the application... a world of pain. In the end, I have decided to use node.js and a real browser... probably not what you want to hear. Update me if you make it work though!
Good luck
BadJerry
Techie
 
Posts: 28
Joined: Fri Nov 02, 2012 7:32 am

Re: CEF3 in an activeX control

Postby khalid80 » Sat Dec 03, 2016 6:48 pm

Thanks, what I did and it work so far is to register cefsharp winforms control as ocx and add it to office the major issue is i can insert it from VSTO because CEFsharp.Core is not working in different domain, I tried CEFGlue and chromiumFX but no luck, so i will try again using MFC activeX but with offscreen rendering,so do you remember if you linked to cef statically or dynamically? if you still have the code can you share it so i can start from where you stoped. i think OSR will fix it, i will give a shot.
khalid80
Newbie
 
Posts: 2
Joined: Sat Nov 12, 2016 9:39 am

Re: CEF3 in an activeX control

Postby BadJerry » Mon Dec 05, 2016 5:05 am

Drop me an email on jerome at askia dot com... I am not even sure the thing compiles anymore - but I still have it - found it on a back up from 2 computers ago :)...
BadJerry
Techie
 
Posts: 28
Joined: Fri Nov 02, 2012 7:32 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 51 guests