title: Using a COM DLL in delphi - Access violation in MSVCR80D.dll error
body: <p>I need to use a DLL created using .NET framework. This DLL is made COM visible.</p>
  
  <p>I want to use this DLL in an application created using Delphi 2006. I have followed following steps:</p>
  
  <ol>
  <li>Registered the DLL using regscr32.</li>
  <li><p>Imported the type library using
  Delphi IDE. It created
  _TLB.pas file. Following signature was created in TLB file.</p>
  
  <pre>
  function TValidationRequest.Process(var meterBSN: WideString; var NICSerial: WideString; 
                                      var partNumber: WideString; var otherConfig: WideString; 
                                      out returnMessage: WideString): Smallint;
  begin
    Result := DefaultInterface.Process(meterBSN, NICSerial, partNumber, otherConfig, returnMessage);
  end;
  </pre></li>
  <li><p>I tried to call the method using
  following code snippet.</p></li>
  </ol>
  
  <pre>
  procedure TForm1.buttonClick(Sender: TObject);
  var
    valReq: TValidationRequest;
    s1, s2, s3, s4, s5: WideString;
    o: WideString;
  begin
    valReq := TValidationRequest.Create (Self);
    try
      valReq.Process (s1, s2, s3, s4, o);
      MessageDlg(o, mtInformation, [mbOK], 0);
    finally
      valReq := nil;
    end;
  end;
  </pre>
  
  <p>But I get following error when Process method is called.
  <a href="https://i.stack.imgur.com/AS3AW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AS3AW.png" alt="alt text"></a>
  </p>
  
  <p>Please can you suggest any solution?</p>