Re: How to unwrap Interface correctly
Posted: Fri Mar 09, 2018 9:02 am
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.
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.