unit NumberForm;
 
interface
 
uses
 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
 StdCtrls;
 
type
 TNumberFrm = class(TForm)
 GetBtn: TButton;
 SetBtn: TButton;
 NumberEdit: TEdit;
 procedure GetBtnClick(Sender: TObject);
 procedure SetBtnClick(Sender: TObject);
 private
 { Private declarations }
 public
 { Public declarations }
 end;
 
var
 NumberFrm: TNumberFrm;
 
implementation
 
{$R *.DFM}
 
function GetNumber:integer;stdcall;external 'NumberDLL.dll';
procedure SetNumber(NewNumber:integer);stdcall;external 'NumberDLL.dll';
 
procedure TNumberFrm.GetBtnClick(Sender: TObject);
begin
 NumberEdit.Text := IntToStr(GetNumber);
end;
 
procedure TNumberFrm.SetBtnClick(Sender: TObject);
begin
 try
 SetNumber(StrToInt(NumberEdit.Text));
 except
 on EConvertError do ShowMessage('No es un nmero vlido. Nmero no establecido.');
 end;
end;
 
end.