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.
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.
How to unwrap Interface correctly
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact: