Page 1 of 1

Slow MS Excel startup while a web browser is running

Posted: Tue Mar 24, 2020 4:11 pm
by Christoph
Hello,

first of all, I did read Issue #139 which describes the same problem and I checked our settings, but still the problem is there on our side.

We use subprocess like

Code: Select all

program SubProcess;

{$I cef.inc}

uses
  {$IFDEF DELPHI16_UP}
  WinApi.Windows,
  {$ELSE}
  Windows,
  {$ENDIF }
  uCEFApplication,
  uMyV8Handler in 'uMyV8Handler.pas',
  globalvars in 'globalvars.pas';

{$SetPEFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}

begin
  GlobalCEFApp := TCefApplication.Create;

  GlobalCEFApp.OnContextCreated := GlobalCEFApp_OnContextCreated;
  GlobalCEFApp.OnProcessMessageReceived := GlobalCEFApp_OnProcessMessageReceived;

  GlobalCEFApp.StartSubProcess;
  GlobalCEFApp.Free;
end.
and in our application we have:

Code: Select all

  GlobalCEFApp := TCefApplication.Create;
  GlobalCEFApp.BrowserSubprocessPath := 'SubProcess.exe';
  GlobalCEFApp.Cache  := ''; 
  GlobalCEFApp.Locale := 'de';
  GlobalCEFApp.FlashEnabled         := False;
  GlobalCEFApp.EnableHighDPISupport       := True;
  GlobalCEFApp.FastUnload                 := True;
  GlobalCEFApp.MustFreeLibrary := False;

  GlobalCEFApp.OnContextInitialized := GlobalCEFApp_OnContextInitialized;

Any idea what we can do to solve the problem? Thank you!

Re: Slow MS Excel startup while a web browser is running

Posted: Tue Mar 24, 2020 5:29 pm
by salvadordf
Hi,

What CEF4Delphi version are you using?

Re: Slow MS Excel startup while a web browser is running

Posted: Wed Mar 25, 2020 6:36 am
by Christoph
Hello,

we have
cef_binary_79.1.36+g90301bd+chromium-79.0.3945.130_windows64

Readme.MD in trunk-Folder says
CEF4Delphi uses CEF 79.1.36 which includes Chromium 79.0.3945.130

Re: Slow MS Excel startup while a web browser is running

Posted: Thu Mar 26, 2020 10:36 am
by salvadordf
I don't have MS Office so I built the "Subprocess" demo and I asked someone with Office 2016 to test it.
He said that Excel started up normally while the CEF4Delphi demo was running.
I used Delphi 10.3.3 to build that demo and he did the test in Windows 7.

Perhaps your Office, Delphi or Windows versions are different but it's probable that there's some other pas unit in the "uses" clause that is creating window handles and causing this issue.

Please, check your "uses" clause and if you can't find anything then provide a complete demo to reproduce this issue.

Re: Slow MS Excel startup while a web browser is running

Posted: Thu Mar 26, 2020 3:58 pm
by Christoph
Excel Start Test.zip
I did check the uses clause of the project. Starting point was

Code: Select all

  System.IOUtils,
  System.SysUtils,
  Winapi.Windows,  
  Vcl.Forms,
  Vcl.Themes,
  Vcl.Styles,
  Winapi.Messages,
  Vcl.Dialogs,
  Vcl.Controls,
  IniFiles,
  uCEFApplication,
This could be reduced to

Code: Select all

//  System.IOUtils,
//  System.SysUtils,
  Winapi.Windows,
  Vcl.Forms,
//  Vcl.Themes,
//  Vcl.Styles,
//  Winapi.Messages,
//  Vcl.Dialogs,
//  Vcl.Controls,
  IniFiles,
  uCEFApplication,
But unfortunately the problem still remains...

Please find a demo project attached. Just start the project and then try to start EXCEL, the size of the EXCEL-file does not matter, I had a small file with only 9kB. If you are waiting for EXCEL to open the file while the project ist running, then close EXCEL an reopen the EXCEL file, the problem is not there, which means from my point of view this only happens when you open EXCEL the first time after the Delphi app was started.

Delphi project was compiled with Rio 10.3.3, 64Bits, Office Version is Office 2016 running on Windows 10

SubProcess is as described in my first article.

Re: Slow MS Excel startup while a web browser is running

Posted: Sun Mar 29, 2020 10:07 am
by salvadordf
Sorry for the delay.

Try replacing this line in the SubProcess project :

Code: Select all

GlobalCEFApp := TCefApplication.Create;
by this line :

Code: Select all

GlobalCEFApp := TCefApplicationCore.Create;
Also check that "globalvars.pas" unit doesn't use the "Forms" unit.

Re: Slow MS Excel startup while a web browser is running

Posted: Tue Mar 31, 2020 4:37 pm
by Christoph
Hello,

I am glad to say that

Code: Select all

GlobalCEFApp := TCefApplicationCore.Create;
did the trick!

Thank you very much!