Page 1 of 1

Error creating new context

Posted: Mon Dec 09, 2019 11:27 am
by alpires2000
Hi Guys, in previous version I used this code to create a new context:

TempContext: ICefRequestContext;
..
..
..
TempContext := TCefRequestContextRef.New('', '', false, false, false, false);

Well, today I updated to the new version and when i compile my project the following error occurs in TCefRequestContextRef.New:

"There is no overloaded version of 'New' that can be called with these arguments"

Some idea how to fix it?

Another error is occurring on my extension:

class procedure TTestExtension.sendresulttobrowser(const msgtext, msgname : string);
var
msg: ICefProcessMessage;
begin
msg := TCefProcessMessageRef.New(msgname);
msg.ArgumentList.SetString(0, msgtext);

TCefv8ContextRef.Current.Browser.SendProcessMessage(PID_BROWSER, msg);
end;

Error: Undeclared identifier: "SendProcessMessage"

why this error is occurring in this new version?

Thanks
Alexandre

Re: Error creating new context

Posted: Mon Dec 09, 2019 11:59 am
by salvadordf
Hi,

The CEF API changed a little bit recently and now TCefRequestContextRef has fewer parameters.

Use this code to create it :

Code: Select all

TempContext := TCefRequestContextRef.New('', '', False, False, False);

Re: Error creating new context

Posted: Mon Dec 09, 2019 12:01 pm
by salvadordf
The "SendProcessMessage" procedure was moved to ICefFrame.

Check the "BREAKING CHANGES" thread to see a complete list of changes since the last time you used CEF4Delphi :
https://www.briskbard.com/forum/viewtopic.php?f=8&t=739

Re: Error creating new context

Posted: Mon Dec 09, 2019 1:51 pm
by alpires2000
Worked, thanks.