dynamically calling a function inside a dll with delphi 1

>Library TEST;
>uses Dialogs;
>procedure Proc1(id:integer); sdtcall;
>begin
>     messagedlg('TEST',mterror,[mbok],0);
>end;
>exports
>       Proc1 index 1 name 'Proc1';
>begin
>end.
>
>Then I use the following code to call the exported procedure,
>
>procedure TForm1.Button1Click(Sender: TObject);
>type
>    TMyProc=procedure (id:integer);
>var
>   hDLL:THandle;
  MyProc : TmyProc;
>begin
>  hDLL:=LoadLibrary(PChar('c:\ab2\test.dll'));
>  @MyProc:=GetProcAddress(hDll, PChar('Proc1'));
>  MyProc(0);
>  FreeLibrary(hDLL);
>end;