F
fifa2000
Unregistered / Unconfirmed
GUEST, unregistred user!
能解释一下具体函数的作用吗?
多谢
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;
多谢
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;