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/)
-   -   Safe-casting Pointers (https://www.delphipraxis.net/179948-safe-casting-pointers.html)

DP News-Robot 12. Apr 2014 20:10

Safe-casting Pointers
 
You cannot safe-cast a pointer. This will fail:ptr as TProjectYou can only cast pointers the unsafe way:TProject(ptr)That is, unless you use this neat trick:TObject(ptr) as TProjectThis will also catch programming errors, specifically a pointer that doesn’t point to an object. --- Published under ...http://feeds.feedburner.com/~r/delph...~4/8akpZ74f9_M

More...


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:06 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