Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Why this is does not work?

Post Reply
Fvert
Posts: 19
Joined: Fri Oct 22, 2021 10:22 am

Why this is does not work?

Post 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?
User avatar
salvadordf
Posts: 4580
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Why this is does not work?

Post 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
Post Reply