문제

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