自定義了一個Exception的子類
TInetException = class(System.SysUtils.Exception)
private
protected
procedure RaisingException(P: PExceptionRecord); override;
public
end;
繼承了RaisingException子類,可是編譯的時候報錯, E2037 Declaration of 'RaisingException\' differs from previous declaration,為什么?
uj5u.com熱心網友回復:
看看Exception是怎么宣告RaisingException的啊uj5u.com熱心網友回復:
宣告在 protected,虛擬的uj5u.com熱心網友回復:
函式原型貼出來啊uj5u.com熱心網友回復:
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; //繼承的這個
uj5u.com熱心網友回復:
在TInetException宣告之前是不是定義了另一個PExceptionRecord,導致跟原來的不一致uj5u.com熱心網友回復:
privateprotected
procedure RaisingException(P: PExceptionRecord); override;
public 可能是 private protected public 里的Exception
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/77508.html
標籤:語言基礎/算法/系統設計
