Page 1 of 1

Project crash Delphi in Debug mode

Posted: Fri Feb 28, 2025 1:32 pm
by Martin Poulsen
Hi

I'm new to Cef4Delphi. we are looking for a browser to your win32 app and think Cef4Delphi i interesting.
I downloaded Cef4Delphi and binary Cefsharp, installed it. Builded and run the Demo\Delphi_VCL\simpleBrowser2 it seems fin (without the debugger)

I implemented CreateGlobalCEFApp, GlobalCEFApp.StartMainProcess and DestroyGlobalCEFApp and made a dialog allmost as in SimpleBrowser Demo
And Delphi crashes very hard when I start my win32 app with Debugger
it crashes in
GlobalCEFApp.StartMainProcess
TCefApplicationCore.SingleExeProcessing
TCefApplicationCore.InitializeLibrary
cef_initialize(CefLib.dll) <---- Here something goes wrongs i a thread
I did remember to insert {$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}
As in the simpleBrowser2 project the app seems to work when running from explore or Delphi without debugger

I'm using Delphi 11.3 professionel (With Devexpress VCL) on a Windows 11 Pro

Any good ideas?

Best regards

Martin Poulsen

Re: Project crash Delphi in Debug mode

Posted: Fri Feb 28, 2025 2:14 pm
by salvadordf
Hi,

Please, check that the contents of the "release" and "resources" folders of the CEF binaries are copied to the same directory as the executable.

The CEF binaries for 32 bits in Windows look like this :
Image

All the demos are configured to create the executable inside the CEF4Delphi\bin directory. Copy the CEF binaries into CEF4Delphi\bin directory too.

I just updated the screenshots in the Wiki page :
https://github.com/salvadordf/CEF4Delphi/wiki/Before-you-run-the-demos

Try to run the demos first. Then add the code to your application.

If your application opens databases in the initialization section then you should use a different executable for the CEF subprocesses. See the "SubProcess" demo.