It requires non-crossplatform assembly code. The best way to learn is to look at Pascal Script for Delphi http://www.remobjects.com/page.asp?i...-EEBBE7E302E6}). Basically you have to push the pointer to the class instance onto the stack, then push the method address and variables onto the stack. Call the method and check the stack and registers for return values. Finally cleanup after yourself. Honestly, this isn't something I fell comfortable explaining more then just pointing to a sample, as far as I know there is no other way that will work. I can show you code that will compile, but it will blow up when you run it .

Actually, here is code that will compile (in theory you would only have to put the method pointer above the calling of the actual method in practice it doesn't work):[pascal]program cbtest2;

{$mode objfpc}{$H+}

uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes
{ add your units here };

type
TMyCallback = procedure(intval1 : integer; obj : TObject) of object;
PMyCallback = ^TMyCallback;

{ TMyCallbackList }

TMyCallbackList=class
private
fMethods : TList;
function getCount: integer;
function GetMethod(index: integer): TMyCallback;
public
constructor Create;
destructor Destroy; override;

function Add(WhatMethod : TMyCallback) : integer;
property Method[index:integer]: TMyCallback read GetMethod;
property Count : integer read getCount;
end;

{ TMyObject }

TMyObject = class
public
constructor Create(WhatList : TMyCallbackList);

procedure ACallback(intval1 : integer; obj : TObject);
end;

{ TMyObject }

constructor TMyObject.Create(WhatList: TMyCallbackList);
begin
WhatList.Add(@ACallback);
end;

procedure TMyObject.ACallback(intval1: integer; obj: TObject);
begin
writeln('Testing the callback method: ', integer(pointer(self)), #9, intval1, #9, integer(pointer(obj)));
end;

{ TMyCallbackList }

function TMyCallbackList.getCount: integer;
begin
result := fMethods.Count;
end;

function TMyCallbackList.GetMethod(index: integer): TMyCallback;
begin
result := TMyCallback(fMethods[index]^);
end;

constructor TMyCallbackList.Create;
begin
fMethods := TList.Create;
end;

destructor TMyCallbackList.Destroy;
begin
fMethods.Free;
inherited Destroy;
end;

function TMyCallbackList.Add(WhatMethod: TMyCallback): integer;
begin
fMethods.Add(@WhatMethod);
end;

var
ml : TMyCallbackList;
o : TMyObject;
i : Integer;
begin
ml := TMyCallbackList.Create;
try
o := TMyObject.Create(ml);
try
for i := 0 to 9 do
ml.Method[0](i, nil);
finally
o.Free;
end;
finally
ml.Free;
end;
end.
[/pascal]