Page 1 of 1

Why this is does not work?

Posted: Fri Nov 12, 2021 5:28 pm
by Fvert
CreateGlobalCEFApp;
GlobalCEFApp.StartMainProcess;
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm1, Form1);
Application.Run;
DestroyGlobalCEFApp;

//second time this does not work
CreateGlobalCEFApp;
GlobalCEFApp.StartMainProcess;// acess violation

Why?

Re: Why this is does not work?

Posted: Sun Nov 14, 2021 11:52 am
by salvadordf
Hi,

CEF can only be initialized once per process. This is a CEF feature and there's no workaround.

Use the code from TabbedBrowser2 or MDIBrowser demos if you need to run several browsers in one application.

Read this document for more information :
https://www.briskbard.com/index.php?lang=en&pageid=cef