![]() |
StringToClass for TCustomAttribute descendant?
Ich benötige eine Umwandlung eines Strings ('TestListAttribute') in eine Klasse. Wie kann man einen String in eine Klasse umwandeln, die von TCustomAttribute abgeleitet ist?
Delphi-Quellcode:
interface
TestListAttribute = class(TCustomAttribute) end; implementation procedure Frage; var AClass : TClass; AName : String; begin AName := 'TestListAttribute'; AClass := StringToClass(AName); // how to implement StringToClass()? end; |
AW: StringToClass for TCustomAttribute descendant?
Via RTTI suchen.
Ich wüsste jetzt auch keinen Grund, wozu man sowas gebrauchen könnte, drum hat da auch niemand 'ne zentrale Registrierungsstelle dafür eingebaut. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:24 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 by Thomas Breitkreuz