Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Pointer und FindComponent (https://www.delphipraxis.net/2373-pointer-und-findcomponent.html)

nailor 20. Jan 2003 16:42


Pointer und FindComponent
 
Delphi-Quellcode:
PPanel = ^TPanel;

a: PPanel;

a := @TPanel(FindComponent('Panel' + inttostr(Aktiv + 1)));
Das geht nicht, weil angeblich der Teil nach dem "@" nicht Variabel ist, und man nur von Variablen die Adresse abfragen kann. Was soll ich machen, wenn ich jetzt aber unbedingt einen pointer auf das PAnel haben will?

Gollum 20. Jan 2003 18:48

Hallo,

TPanel ist schon ein Zeiger.

Code:
 var a:TPanel;
...
  a:=TPanel(FindComponent('Panel' + inttostr(Aktiv + 1)));
...


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:47 Uhr.

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