procedure TForm1.Button1Click(Sender: TObject);{工程文件}
var
f_max: function (X, Y:Integer):Integer; stdcall;
begin
dllinstance:=loadlibrary('dll.dll');
f_max := getprocaddress(dllinstance,'Max');
edit1.text:=inttostr(f_max(2, 5));
freelibrary(dllinstance);
end;
var
f_max: function (X, Y:Integer):Integer; stdcall;
begin
dllinstance:=loadlibrary('dll.dll');
f_max := getprocaddress(dllinstance,'Max');
edit1.text:=inttostr(f_max(2, 5));
freelibrary(dllinstance);
end;
var
f_max: function (X, Y:Integer):Integer; stdcall;
这句有错。
var
pfunc: function (X, Y:Integer):Integer; stdcall;
pfunc:tfarproc;
这两句有什么区别或者说应怎么理解?
pFuncType = function (X, Y:Integer):Integer; stdcall;然后
var pfunc: pFuncType; 也可以TFarProc也是一个函数指针罢了
这样行不行?
function max(x,y:integer):integer;external 'dll.dll' index 1;