Adding a type declaration and some typecasting, but with some warning notes.
, somedelegate , , AV. , SomeProc , , , ShowMessage.
- , , . AV-.
:
...
type
TSomeDelegate = procedure of object;
var
SomeDelegate: TSomeDelegate;
...
procedure TMyChildClass.SomeProc;
var
method: TMethod;
begin
ShowMessage('Child proc');
method.Code := @TMyBaseClass.SomeProc;
method.Data := Self;
SomeDelegate := TSomeDelegate(method);
end;