Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Error creating new context

Post Reply
alpires2000
Posts: 52
Joined: Sat Dec 09, 2017 4:40 pm

Error creating new context

Post 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
User avatar
salvadordf
Posts: 4571
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Error creating new context

Post 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);
User avatar
salvadordf
Posts: 4571
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Error creating new context

Post 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
alpires2000
Posts: 52
Joined: Sat Dec 09, 2017 4:40 pm

Re: Error creating new context

Post by alpires2000 »

Worked, thanks.
Post Reply