![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Получить из имени класса сам класс [D7, XP]
Pearled © (2006-02-20 16:41:00)Подскажите как имея строку - название класса получить ссылку на сам класс. Например из 'TfmMain' - TfmMain
Pearled (2006-02-21 08:11:00) [1]Всем спасибо.
FindClass() решил проблему.
RO (2006-02-20 16:48:00) [2]FindClass()
Ega23 (2006-02-20 16:46:00) [3]
TObject.ClassName
Returns a string indicating the type of the object instance (as opposed to the type of the variable passed as an argument).
class function ClassName: ShortString;
Description
Use ClassName to find the name (such as ’TButton’) of an object’s type. This is useful for differentiating object instances that are assigned to a variable that has the type of an ancestor class. ClassName returns a string indicating the actual type of the object, rather than a string containing the type of the declared variable.
When reporting exception-handling errors on a particular object, the on statement uses ClassName to do a string comparison of classes.
Оно?
Джо (2006-02-20 16:46:00) [4]FindClass, GetClass. В результате, если класс зарегистрирован возвратит TPersistenClass.
Johnmen (2006-02-20 16:45:00) [5]ClassName?