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.

How to unwrap Interface correctly

Post Reply
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to unwrap Interface correctly

Post by salvadordf »

The wrap and unwrap functions should only be used if you use the internal CEF3 functions directly and it's not recommended.

CEF4Delphi converts all CEF3 classes to Delphi interfaces which are much easier and friendlier to use. It's much safer to use interface variables instead of pointers.

The first code example fails because it's creating a TCefBaseRefCountedRef and it's not possible to cast it as ICefProcessMessage.
An ICefProcessMessage interface can be cast as ICefBaseRefCounted, but it's not possible to cast ICefBaseRefCounted as ICefProcessMessage.
Post Reply