这是我DLL PAS里的代码

unit add1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
procedure Myadd(x:Integer;y:Integer);stdcall;
implementationprocedure Myadd(x:Integer;y:Integer);stdcall;
begin
  ShowMessage(IntToStr(x+y));
end;end.
DLL入口代码
library add;
uses
  SysUtils,
  Classes,
  add1 in 'add1.pas';
exports
   Myadd;begin
end.
主程序代码
unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, GetErrorPro;type
  TForm1 = class(TForm)
    edt3: TEdit;
    btn1: TButton;
    procedure btn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;procedure Myadd(x:Integer;y:Integer);external 'add.dll';implementation{$R *.dfm}procedure TForm1.btn1Click(Sender: TObject);
var
  lib:Integer;
  addproc:FARPROC;
begin
  lib:=LoadLibrary(PChar('add.dll'));  if lib <> 0 then
    addproc:=GetProcAddress(lib,'Myadd');  if @addproc <> nil then
      Myadd(0,0);
    
      ErrorPro;
end;end.GetErrorPro里的代码 主要是解释错误类型,高手可以跳过
unit GetErrorPro;interfaceuses
  Windows,Dialogs,SysUtils;procedure ErrorPro;implementationprocedure ErrorPro;
var
  dwLastError:DWORD;
begin
  dwLastError := GetLastError;
  ShowMessage(Format('%s[%d]',[SysErrorMessage(dwLastError ),dwLastError ]));
end;
end.最后为什么出现的结果却不是我想要的结果,是不是什么数据类型有什么问题。麻烦高手讲解下