Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Delphi-News aus aller Welt (https://www.delphipraxis.net/58-delphi-news-aus-aller-welt/)
-   -   Casting an Interface to a Class, the efficient way (https://www.delphipraxis.net/169195-casting-interface-class-efficient-way.html)

DP News-Robot 4. Jul 2012 14:50

Casting an Interface to a Class, the efficient way
 
Delphi 2010 added support for the “as” to cast an interface reference to its implementation class. Cast interface as class type IFoo = interface ... end; TFoo = class (TInterfacedObject, IFoo) ... end; ... var intf : IFoo; var foo : TFoo; ... intf := TFoo.Create; ... foo := intf as ...http://feeds.feedburner.com/~r/delph...~4/1_zJuFAVenA

More...


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:37 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz