[dcc32 Warning] SjAppGetVersion.pas(13): W1010 Method 'Create' hides virtual method of base type 'TComponent'
TComponent = class(TPersistent, IInterface, IInterfaceComponentReference)
public
constructor Create(AOwner: TComponent); virtual;
TSjAppVersion = class(TComponent)
public
constructor Create( AOwner : TComponent );
There are three alternatives to take when solving this warning.
(1) constructor Create( AOwner : TComponent ); override;
You could specify override to make the derived class' procedure also virtual,
if the ancestor's respective method is declared as virtual or dynamic, and thus allowing inherited calls to still reference the original procedure.
(2) constructor Create2( AOwner : TComponent );
You could change the name of the procedure as it is declared in the derived class.
Both of these methods are exhibited in the source code snippets above.
(3) constructor Create( AOwner : TComponent ); reintroduce;
You could add the reintroduce directive to the procedure declaration
to cause the warning to be silenced for that particular method.
The reintroduce keyword instructs the Delphi compiler to hide the respective method
and suppress the warning,
because it is unlikely to override a method of the same name from a base class that is not virtual or dynamic.
'할거리 > BC' 카테고리의 다른 글
[ilink32 Error] Error: Unresolved external 'wWinMain' referenced from C0W32W.OBJ (0) | 2015.07.16 |
---|---|
BC++ Enable Debugging (0) | 2015.06.18 |
Indy Send Unicode 문제 (0) | 2015.05.22 |
ExtractStrings의 버그를 SeparateStrings 으로 해결 (0) | 2015.05.14 |
E2034 Cannot convert 'char const[17]' to 'const wchar_t *' (0) | 2015.05.11 |