library dll;uses
  sharemem,
  SysUtils,
  Windows,
  Messages,
  Variants,
  Classes,
  Graphics,
  Controls,
  Forms,
  Dialogs,
  StdCtrls,
  ufrmlog in 'ufrmlog.pas' {Form1},
  uglobal in 'uglobal.pas',
  Ulogin in 'Ulogin.pas' {Form2};{$R *.res}
Function checkuser(AHandle:THandle;var userlogin: Tuserinfo):boolean;stdcall;
var dllfrm:TForm2;
begin
  application.handle:=Ahandle;
  try
    dllfrm := Tform2.create(application);
    dllfrm.Fuserlogin.userid := userlogin.userid;
    dllfrm.edit1.text :=dllfrm.Fuserlogin.userid;
    dllfrm.ShowModal ;
    userlogin.userid :=  dllfrm.Fuserlogin.userid;
    Result := True;
  finally
    dllfrm.Free;
  end;
end;Function showmainfrm(AHandle:THandle;aleft:integer;atop:integer):Tdate;stdcall;
var myfrm:TForm1;
begin
  application.handle:=Ahandle;
  try
    myfrm := Tform1.create(application);
    myfrm.Left :=aleft;
    myfrm.top := atop;
    myfrm.ShowModal ;
    result :=myfrm.CurDate;
  finally
   myfrm.Free;
  end;
end;
exports
    showmainfrm  ,
  checkuser  ;
end.