unit UTestDLL1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    BBeep: TButton;
    Edit1: TEdit;
    BCode: TButton;
    BDialog: TButton;
    procedure BBeepClick(Sender: TObject);
    procedure BCodeClick(Sender: TObject);
    procedure BDialogClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
procedure DoBeep; stdcall; external 'MyDLL.DLL';
//procedure MyBeep; stdcall; external 'MyDLL.DLL' name 'DoBeep';
//procedure DoBeep; stdcall; external 'MyDLL.DLL' index 1;
function Code(S: PChar; Key: integer): PChar; stdcall; external 'MyDLL.DLL';
function MyDialog(User: PChar): PChar; stdcall;  external 'MyDLL.DLL';

procedure TForm1.BBeepClick(Sender: TObject);
begin
// MyBeep;
 DoBeep;
end;

procedure TForm1.BCodeClick(Sender: TObject);
begin
 Edit1.Text := Code(PChar(Edit1.Text), 5);
end;

procedure TForm1.BDialogClick(Sender: TObject);
begin
 Edit1.Text := MyDialog('Пользователь');
end;

end.
