title: Delphi/pascal: overloading a constructor with a different prototype
body: <p>I'm trying to create a child class of TForm with </p>
  
  <ol>
  <li>a special constructor for certain cases, and </li>
  <li>a default constructor that will maintain compatibility with current code.</li>
  </ol>
  
  <p>This is the code I have now:</p>
  
  <pre><code>interface
    TfrmEndoscopistSearch = class(TForm)
    public
      /// original constructor kept for compatibility
      constructor Create(AOwner : TComponent); overload; override;
      /// additional constructor allows for a caller-defined base data set
      constructor Create(AOwner : TComponent; ADataSet : TDataSet; ACaption : string = ''); overload;
    end;
  </code></pre>
  
  <p>It seems to work, but I always get the compiler warning:</p>
  
  <pre>
  [Warning] test.pas(44): Method 'Create' hides virtual method of base type 'TCustomForm'
  </pre>
  
  <ul>
  <li>Adding "overload;" after the second constructor won't compile.  "[Error] test.pas(44): Declaration of 'Create' differs from previous declaration".</li>
  <li>making the second constructor a class function compiles without any errors or warnings, but dies with an access violation at runtime (all member vars are nil).</li>
  </ul>