自定义了一个Exception的子类  TInetException = class(System.SysUtils.Exception)
  private
  protected
    procedure RaisingException(P: PExceptionRecord); override;
  public
  end;继承了RaisingException子类,可是编译的时候报错, E2037 Declaration of  'RaisingException\' differs from previous declaration,为什么?

解决方案 »

  1.   

    看看Exception是怎么声明RaisingException的啊
      

  2.   

    声明在 protected,虚拟的
      

  3.   

    unit System.SysUtils 里原形声明  Exception = class(TObject)
      private
        FMessage: string;
        FHelpContext: Integer;
        FInnerException: Exception;
        FStackInfo: Pointer;
        FAcquireInnerException: Boolean;
        class constructor Create;
        class destructor Destroy;
      protected
        procedure SetInnerException;
        procedure SetStackInfo(AStackInfo: Pointer);
        function GetStackTrace: string;
        // This virtual function will be called right before this exception is about to be
        // raised. In the case of an external non-Delphi exception, this is called soon after
        // the object is created since the "raise" condition is already in progress.
        procedure RaisingException(P: PExceptionRecord); virtual;   //继承的这个
      

  4.   

    在TInetException声明之前是不是定义了另一个PExceptionRecord,导致跟原来的不一致
      

  5.   

      private
      protected
        procedure RaisingException(P: PExceptionRecord); override;
      public    可能是 private protected public 里的Exception