I have an issue trying to create Delphi Chromium Embedded instance with code

var
  Chromium: TChromium;
begin
  Chromium := TChromium.Create(TcxTabSheet1);
  Chromium.Parent := TWinControl(TcxTabSheet1);
  Chromium.Align := alClient;
  Assert(Assigned(Chromium.Browser), 'HERE! Why Browser is not assigned.');
  ...
end;

Seems like Browser property is initialized when

procedure TCustomChromium.CreateWindowHandle(const Params: TCreateParams);

is called.

Why CreateWindowHandle is not called in my code?

有帮助吗?

解决方案

My comment as an answer:

The reason Chromium.Browser is not yet assigned, when the Browser property is initialized from the CreateWindowHandle, is:

Because nothing has been done yet that calls HandleNeeded (which will call CreateWindowHandle when none has been assigned yet)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top