title: Invalid Pointer Operation
body: <p>I have a form that contains a <code>TOpenDialog</code> component (<code>OpenDialog1</code>) and a button.
  <code>OpenDialog1</code> has the <code>ofAllowMultiSelect</code> (of <code>Options</code>) property set to true.</p>
  
  <p>Upon clicking the button the method <code>AddFilesToListView</code> is executed:</p>
  
  <pre><code>procedure TForm4.AddFilesToListView();
  var
    ListItem : TListItem;
    I: Integer;
    F : File;
    LengthOfAudio : TDateTime;
    previousCursor : TCursor;
  
  begin
    previousCursor := Self.Cursor;
    Self.Cursor := crHourGlass;
  
    if OpenDialog1.Execute then
    begin
      for I := 0 to OpenDialog1.Files.Count - 1 do begin
        if FileExists(OpenDialog1.FileName) then begin
          ListItem:=ListView1.Items.Add;
          ListItem.Caption := 'Test';
          ListItem.SubItems.Add(ExtractFileName(OpenDialog1.Files[I]));
          ListItem.SubItems.Add(ExtractFilePath(OpenDialog1.Files[I]));
        end else
          raise Exception.Create('File does not exist.');
      end;
    end;
  
    Self.Cursor := previousCursor;
  
    OpenDialog1.Files.Free;
  end;
  </code></pre>
  
  <p>When running the application, selecting the first file, I have no problem but when wanting to select the second one, I get an error saying "Project project3 raised an exception class EInvalidPointer with message 'Invalid Pointer Operation'."</p>
  
  <p>What's the cause of this, how do I correct this?</p>