title: how to call a Dll and pass parameters to it in delphi 7
body: <p>I am a delphi noob so please help me out with this. I have created a DLL with the following code:</p>
  
  <pre><code> library PRdll;
     uses
   ExceptionLog, SysUtils,Classes,Dialogs;
  
  {$R *.res}
  
    function DllMessage(var a:integer):Integer;stdcall;export;
    begin
        Showmessage('GHelloa');//this is displayed
        ShowMessage(IntToStr(a));//I get the error at this point
         Result:=5;
    end;
  
      exports DllMessage;
    begin
    end.
  </code></pre>
  
  <p>The corresponding call to the DLL is given by this code:</p>
  
  <pre><code>    var
        FDll: TFDll;
         function DllMessage(var a:integer):integer;stdcall;external 'PRDll.dll';
       implementation
  
      {$R *.dfm}
  
         procedure TFDll.btnCallDllClick(Sender: TObject);
        var
         i:integer;
        s1:string;
        begin
             i:=5;
            s1:=IntToStr(DllMessage(i));
           //ShowMessage(s1);
           end;
  </code></pre>
  
  <p>I get an access error. Why does this happen . ANybody ? help!!!
  Thanks in Advance</p>