Форум: "Основная";
Текущий архив: 2002.01.24;
Скачать: [xml.tar.bz2];
ВнизДобавление элемента в PopUP-меню в run-time. Найти похожие ветки
← →
Light Elf (2002-01-06 18:33) [6]Вот ведь незадача, не получается присвоить.
В хэлпе сказано:
type
TMethod = procedure of object;
TNotifyEvent = procedure(Sender: TObject) of object;
These types represent method pointers. A method pointer is really a pair of pointers; the first stores the address of a method, and the second stores a reference to the object the method belongs to. Given the declarations
type
TNotifyEvent = procedure(Sender: TObject) of object;
TMainForm = class(TForm)
procedure ButtonClick(Sender: TObject);
...
end;
var
MainForm: TMainForm;
OnClick: TNotifyEvent
we could make the following assignment.
OnClick := MainForm.ButtonClick;
Two procedural types are compatible if they have
the same calling convention,
the same return value (or no return value), and
the same number of parameters, with identically typed parameters in corresponding positions. (Parameter names do not matter.)
Если этому последовать, то выскакивает ошибка
Incompatible Types: TNotifyEvent and "procedure, untyped pointer or untyped parameter
Так вот как это все-таки сделать? Понимаю, что просто, но как?
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2002.01.24;
Скачать: [xml.tar.bz2];
Память: 0.44 MB
Время: 0.003 c