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.

cef_initialize

Post Reply
X11
Posts: 49
Joined: Thu Jul 25, 2019 10:15 am

cef_initialize

Post by X11 »

screen http://prntscr.com/p2of8i


dpr

Code: Select all

begin
  CreateGlobalCEFApp;

  if GlobalCEFApp.StartMainProcess then
  begin
    Application.Initialize;
    Application.MainFormOnTaskbar := True;
    Application.Title := 'Береста 5';
    Application.CreateForm(TDM, DM);
    Application.CreateForm(TfmMain, fmMain);
    Application.Run;
  end;

  DestroyGlobalCEFApp;
unit

Code: Select all

procedure CreateGlobalCEFApp;
begin
  GlobalCEFApp                            := TCefApplication.Create;
  GlobalCEFApp.OnProcessMessageReceived   := GlobalCEFApp_OnProcessMessageReceived;
  GlobalCEFApp.WindowlessRenderingEnabled := True;
  GlobalCEFApp.EnableHighDPISupport       := false;

  GlobalCEFApp.DisableFeatures            := 'NetworkService,VizDisplayCompositor';

  GlobalCEFApp.FrameworkDirPath           := 'D:\Dev\Chromium\CEF4Delphi\bin';
  GlobalCEFApp.LocalesDirPath             := 'D:\Dev\Chromium\CEF4Delphi\bin\locales';
  GlobalCEFApp.ResourcesDirPath           := 'D:\Dev\Chromium\CEF4Delphi\bin';
end;
User avatar
salvadordf
Posts: 4565
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: cef_initialize

Post by salvadordf »

Hi,

There are some issues with the OSR mode in the current version of the CEF libraries.
If you really need to use the OSR mode then use an older release version of CEF4Delphi.
X11
Posts: 49
Joined: Thu Jul 25, 2019 10:15 am

Re: cef_initialize

Post by X11 »

Why does another application launch with the same settings?
User avatar
salvadordf
Posts: 4565
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: cef_initialize

Post by salvadordf »

It's hard to tell without the source code of both apps but I would use any previous CEF4Delphi release to avoid OSR issues :
https://github.com/salvadordf/CEF4Delphi/releases
X11
Posts: 49
Joined: Thu Jul 25, 2019 10:15 am

Re: cef_initialize

Post by X11 »

this is test project with error: https://app.box.com/s/ytcl6njjgexj5538hmklu9f2v44nujon

in Unit2 comment out 2 lines
1. uses aspr_api;
2. self.Caption := String(PAnsiChar(GetHardwareID));
then the application starts without errors

do not forget to specify the paths for CEF on your computer in uMyCEF4Delphi.pas in procedure CreateGlobalCEFApp.

Note. I user ASProtect SKE (aspack.com/asprotect32.html) for protect my application.
User avatar
salvadordf
Posts: 4565
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: cef_initialize

Post by salvadordf »

I looked at the sources and they seem to be fine.

Perhaps there's a compatibility issue between CEF and aspr.dll
Post Reply