It seems the problem has to do with the way i'm creating the components ; i create on runtime, instead of placing them on the form in design time.
Here is a sample app that i get the crash when navigating to www.bing.com
Code: Select all
unit princ;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, uCEFChromium, uCEFWindowParent, ExtCtrls, OleCtrls, SHDocVw,
uCEFInterfaces, uCEFConstants, uCEFChromiumWindow, uCEFWinControl;
type
TForm1 = class(TForm)
Panel1: TPanel;
Edit1: TEdit;
Button1: TButton;
pweb: TPanel;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure webAfterCreated(Sender: TObject; const browser: ICefBrowser);
private
{ Private declarations }
public
webc:TChromium;
cefwindowparent1 : TCEFWindowParent;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
cefwindowparent1.bringtofront;
webc.LoadURL(edit1.text);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
webc := TChromium.Create(pweb);
cefwindowparent1 := TCEFWindowParent.Create(pweb);
cefwindowparent1.Align := alclient;
cefwindowparent1.Parent := pweb;
webc.CreateBrowser(cefwindowparent1);
end;
procedure TForm1.webAfterCreated(Sender: TObject; const browser: ICefBrowser);
begin
PostMessage(Handle, CEF_AFTERCREATED, 0, 0);
end;
end.