I could pass the following to the old version of the dll
type
PCallbackList = ^TCallbackList;
TCallbackList = record
arg: Pointer;
CallBack1: procedure(arg: Pointer; p1: Pointer; error: PAnsiChar); cdecl;
CallBack2: procedure(arg: Pointer; error: PAnsiChar); cdecl;
end;
and when the callback is fired I cast arg to the object instance that I assigned to it before I passed the callback list.
now the dll has changed and the new signature is:
type
PCallbackList = ^TCallbackList;
TCallbackList = record
CallBack1: procedure(p1: Pointer; error: PAnsiChar); cdecl;
CallBack2: procedure(error: PAnsiChar); cdecl;
end;
so the arg pointer now is removed and I have no way to pass the reference of the object instance to the dll with the list, so I have no way to know which instance the callback belongs to.
so how to pass an object method as a callback method?