salvadordf / CEF4Delphi

CEF4Delphi is an open source project to embed Chromium-based browsers in applications made with Delphi or Lazarus/FPC for Windows, Linux and MacOS.
https://www.briskbard.com/forum/
Other
1.19k stars 363 forks source link

Browser never created using TChromiumWindow #479

Closed mbouyahi closed 8 months ago

mbouyahi commented 9 months ago

Hello Team , I have an issue in my existing C++ VCL application while trying to create browser using TChromiumWindow :: the browser is never created and i'm unable to see any web page loaded in my CEFBrowser form . I did all the steps mentioned in the this link : https://www.briskbard.com/index.php?lang=en&pageid=cef

Here is how initialize the form when loading my existing application : Application->Initialize(); ...... Application->CreateForm(__classid(TForm1), &Form1); Application->Run();

You can see in attachement the new CEFBrowser form i created(similar to simpleBrowsewr in the demo in c++ language). ` [NXMENU.zip](https://github.com/salvadordf/CEF4Delphi/files/12727870/NXMENU.zip) and this is how i instanciate it : in an existing form : std::auto_ptr frm(new TForm1(this)); frm->ShowModal();`

I'm using the IDE : RAD Studio 10.1 Berlin.

Can you please help with this issue? Thank you in advance for your collaboration

salvadordf commented 9 months ago

Hi,

The provided source code doesn't include the creation and initialization of GlobalCEFApp. It's not possible to create browsers without a fully initialized GlobalCEFApp.

The SimpleBrowser.dpr file creates GlobalCEFApp and calls GlobalCEFApp.StartMainProcess before executing any Application method. See the code here : https://github.com/salvadordf/CEF4Delphi/blob/master/demos/Delphi_VCL/SimpleBrowser/SimpleBrowser.dpr

Please, use our forum for more questions : https://www.briskbard.com/forum/