is CEF (build CEF 3.2454.1320) in MFC supported

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.

is CEF (build CEF 3.2454.1320) in MFC supported

Postby meitis1 » Fri Sep 18, 2015 10:36 am

I looked into :
viewtopic.php?f=11&t=11606&p=27621#p27621

But that is in 'Board index ‹ NON-SUPPORT SPECIFIC' so I am wandering should CEF work in MFC application ?
I looked in demo cefclient and unlike old CEF1 it doesn't show anymore any use of CreateBrowserSync but the function is still available.
As you can see in that thread I tried and looks like it works but my main problem for now is cleaning i.e. exiting dialog.
I can't find any explanation/documentation on how I should clean/destroy/stop cef and run it again later in another dialog.
any help is very appreciated.
thanks
meitis1
Newbie
 
Posts: 8
Joined: Tue Sep 15, 2015 3:55 pm

Re: is CEF (build CEF 3.2454.1320) in MFC supported

Postby magreenblatt » Fri Sep 18, 2015 2:36 pm

Google "cef mfc example"
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: is CEF (build CEF 3.2454.1320) in MFC supported

Postby meitis1 » Mon Sep 21, 2015 10:44 am

sorry but I have to say this is not an answer and please don't reply if you don't want to answer.
I did google a lot more than just what you said.
There is also in viewtopic.php?f=11&t=11606&p=27621#p27621
example that I took and upgraded to latest CEF and I had issues so I asked here is MFC supported because there is no clear example of it nor clear instructions on how to use it.
Your "cefclient" and "cefsimple" are now so simplistic and so many cef can do that is not shown in that demo.
There is so many ways CEF can be adopted and embedded into other applications but examples and instructions are so out of date or simply not existing that I had no choice but to rely on this forum as my last hope and I am getting answers "do google how to use it".
I'll just give you one single sample:
in your latest "cefclient" you do:
// Create a ClientApp of the correct type.
CefRefPtr<CefApp> app;
ClientApp::ProcessType process_type = ClientApp::GetProcessType(command_line);
if (process_type == ClientApp::BrowserProcess)
app = new ClientAppBrowser();
else if (process_type == ClientApp::RendererProcess)
app = new ClientAppRenderer();
else if (process_type == ClientApp::OtherProcess)
app = new ClientAppOther();

Now in mfc there is no command line in CCef3SamplesMfcDialogApp::InitInstance() so I think you understand how it is logical to ask at least one simple question:What is the right way to do this in MFC?
So many other questions. I have to work for days to build sample MFC app only to see if it is possible and how to have synchronized JS call from cef to desktop app.
It would be so helpful and reduce number of questions in this forum if proper examples were made and included and not only 'cefclient' and 'cefsimple'.
thanks
meitis1
Newbie
 
Posts: 8
Joined: Tue Sep 15, 2015 3:55 pm

Re: is CEF (build CEF 3.2454.1320) in MFC supported

Postby magreenblatt » Mon Sep 21, 2015 2:13 pm

You're correct, it was a bad answer. Sorry about that. Unfortunately it's not feasible for the CEF project to provide and maintain examples in every framework.

CEF is used in MFC applications. The same guidelines documented in the Wiki pages apply to MFC (for example, don't call CefInitialize/CefShutdown multiple times). If you are having specific issues with one of the existing MFC examples returned by the above Google search then you should contact the maintainer of that example.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: is CEF (build CEF 3.2454.1320) in MFC supported

Postby meitis1 » Mon Sep 21, 2015 3:02 pm

thank you.
I already tried and it looks like nobody is updating that sample anymore so I started my own testing sample.
By now it goes well except that any recent cef build is crashing on exit.
Same (lot of exceptions) happens with cefclient in cef_binary_3.2454.1320.g807de3c_windows32 if I set multi_threaded_message_loop = 1.
Any idea what I am missing there or maybe whom/where I can ask about cefclient ?
meitis1
Newbie
 
Posts: 8
Joined: Tue Sep 15, 2015 3:55 pm

Re: is CEF (build CEF 3.2454.1320) in MFC supported

Postby magreenblatt » Mon Sep 21, 2015 3:10 pm

The crash is probably https://bitbucket.org/chromiumembedded/cef/issues/1680. Try the work-around mentioned in that issue.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: is CEF (build CEF 3.2454.1320) in MFC supported

Postby ninja2 » Mon Sep 21, 2015 3:18 pm

A working example of how to make the new project cefsiample win32? I created an application in Visual studio2010 shyn32 and added to the files copied from the example Simple files from debug and nothing works, writes an error



Для всех выходных данных обновления не требуется.
1>cefsimple_win.obj : error LNK2019: ссылка на неразрешенный внешний символ "void __cdecl CefShutdown(void)" (?CefShutdown@@YAXXZ) в функции _wWinMain@16
1>cefsimple_win.obj : error LNK2019: ссылка на неразрешенный внешний символ "void __cdecl CefRunMessageLoop(void)" (?CefRunMessageLoop@@YAXXZ) в функции _wWinMain@16
1>cefsimple_win.obj : error LNK2019: ссылка на неразрешенный внешний символ "bool __cdecl CefInitialize(class CefMainArgs const &,class CefStructBase<struct CefSettingsTraits> const &,class CefRefPtr<class CefApp>,void *)" (?CefInitialize@@YA_NABVCefMainArgs@@ABV?$CefStructBase@UCefSettingsTraits@@@@V?$CefRefPtr@VCefApp@@@@PAX@Z) в функции _wWinMain@16
1>cefsimple_win.obj : error LNK2019: ссылка на неразрешенный внешний символ "int __cdecl CefExecuteProcess(class ....
....
...
...__cdecl(class SimpleHandler *,bool)> *)" (??$?0V?$RunnableAdapter@P8SimpleHandler@@AEX_N@Z@internal@base@@$$A6AXPAVSimpleHandler@@_N@Z$$A6AX01@Z@?$Callback@$$A6AXXZ@base@@QAE@PAU?$BindState@V?$RunnableAdapter@P8SimpleHandler@@AEX_N@Z@internal@base@@$$A6AXPAVSimpleHandler@@_N@Z$$A6AX01@Z@internal@1@@Z)
1>D:\Visual Studio 2010\Projects\test_win32_cef\Debug\winapi.exe : fatal error LNK1120: 21 неразрешенных внешних элементов
1>
ninja2
Newbie
 
Posts: 8
Joined: Mon Sep 21, 2015 1:47 pm

Re: is CEF (build CEF 3.2454.1320) in MFC supported

Postby magreenblatt » Mon Sep 21, 2015 3:27 pm

ninja2 wrote:A working example of how to make the new project cefsiample win32? I created an application in Visual studio2010 shyn32 and added to the files copied from the example Simple files from debug and nothing works, writes an error

Your question is unrelated to this thread. Start a new thread.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 45 guests