Slow MS Excel startup while a web browser is running

Post Reply
Christoph
Posts: 20
Joined: Fri Feb 23, 2018 6:31 am

Slow MS Excel startup while a web browser is running

Post by Christoph » Tue Mar 24, 2020 4:11 pm

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!

User avatar
salvadordf
Posts: 2223
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

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

Post by salvadordf » Tue Mar 24, 2020 5:29 pm

Hi,

What CEF4Delphi version are you using?

Christoph
Posts: 20
Joined: Fri Feb 23, 2018 6:31 am

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

Post by Christoph » Wed Mar 25, 2020 6:36 am

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

User avatar
salvadordf
Posts: 2223
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

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

Post by salvadordf » Thu Mar 26, 2020 10:36 am

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.

Christoph
Posts: 20
Joined: Fri Feb 23, 2018 6:31 am

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

Post by Christoph » Thu Mar 26, 2020 3:58 pm

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.
You do not have the required permissions to view the files attached to this post.

User avatar
salvadordf
Posts: 2223
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

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

Post by salvadordf » Sun Mar 29, 2020 10:07 am

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.

Christoph
Posts: 20
Joined: Fri Feb 23, 2018 6:31 am

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

Post by Christoph » Tue Mar 31, 2020 4:37 pm

Hello,

I am glad to say that

Code: Select all

GlobalCEFApp := TCefApplicationCore.Create;
did the trick!

Thank you very much!

Post Reply