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.

CEF4Delphi with Rasbian 32Bit on Rasp4B 8GB

Post Reply
Shrek_III
Posts: 2
Joined: Thu Jun 30, 2022 6:25 pm

CEF4Delphi with Rasbian 32Bit on Rasp4B 8GB

Post by Shrek_III »

Hi there,

first of all I am pretty new to lazarus, but as I am using delphi on my pc I am pretty sure I can handle some stuff.

After installing CEF4Delphi and adding the binaries, I am now able to successfully run the demos.
In my application I want to add a very simple browser. I just want to show the weather forecast - I will provide the links and the only thing CEF4Delphi needs to do is to show those websites.

I copied most of the code from the SimpleBrowser Demo.

Code: Select all

program project1;

{$mode objfpc}{$H+}

{$I cef.inc}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms, main, alsa_mixer
  { you can add units after this },
  uCEFApplication;

{$R *.res}


begin
  GlobalCEFApp := TCEFApplication.Create;   // <------ crash occurs in this line
  if GlobalCEFApp.StartMainProcess Then
  begin
    CustomWidgetSetInitialization;
    RequireDerivedFormResource:=True;
    Application.Scaled:=True;
    Application.Initialize;
    Application.CreateForm(TForm1, Form1);
    Application.Run;
    CustomWidgetSetFinalization;
  end;

  GlobalCEFApp.Free;
  GlobalCEFApp := nil;
end.
But the marked line raises an exception class 'RunError (232)'
Debugging step by step I found out that

Code: Select all

FCustomCommandLines := TStringList.Create;
in uCEFApplicationCore (line 884) seems to be the main problem.
At this point I am stuck - any help is greatly appreciated...
User avatar
salvadordf
Posts: 4580
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: CEF4Delphi with Rasbian 32Bit on Rasp4B 8GB

Post by salvadordf »

Hi,

Please, download the latest CEF4Delphi version from GitHub :
https://github.com/salvadordf/CEF4Delphi

The latest version creates FCustomCommandLines in the line 887 instead of 884 so I guess you are using an older CEF4Delphi version.

In any case, there shouldn't be any problem creating a simple TStringList.
Is your application using GTK2?
Is your application using the "initialization" section in some unit?

It would be extremely helpful if you could provide a minimal example in order to reproduce this issue in my computer and my Raspberry Pi.
Shrek_III
Posts: 2
Joined: Thu Jun 30, 2022 6:25 pm

Re: CEF4Delphi with Rasbian 32Bit on Rasp4B 8GB

Post by Shrek_III »

Finally got it to work.
Various things I didn't recognize.
(1) didn't set custom compilersettings
(2) had the ChromiumWindow on a tabSheet of a pageController (problem with onActivate)

Thanks for your hints - and you were right, I haven't used the most up to date version - updated, now :)
Post Reply