type
TCallBackFunction = function(s: string): integer;
CallMe(s: string): integer;
procedure TestCallBack(CallBackFunction: TCallBackFunction); far; external 'Other';
{ Note that 'other' is a Dll containing the procedure TestCallBack }
function CallMe(s: PChar): integer;
begin
{ what ever you need to do }
CallMe := 1; { What ever you need to return }
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
TestCallBack(CallMe);
end;
type
TMainFunction = function(s: string): integer;
TestCallBack(MainFunc: TMainFunction);
{ in library Other implementation }
TestCallBack(MainFunc: TMainFunction);
var
result: integer;
begin
result:=MainFunc('test');
end;
function EnumFontsProc(var LogFont: TLogFont; var TextMetric: TTextMetric;
FontType: Integer; Data: Pointer): Integer; stdcall;
begin
with TStrings(Data) do
if ((Count = 0) or (Indexof(LogFont.lfFaceName) = -1)) then
if Pos('@', LogFont.lfFaceName) = 0 then
AddObject(LogFont.lfFaceName, TObject(FontType = TRUETYPE_FONTTYPE));
Result := 1;
end;