Show: Delphi
C++
Display Preferences
E2177 Constructors and destructors not allowed in OLE automation section (Delphi)
From RAD Studio XE2
Go Up to Error and Warning Messages (Delphi) Index
You have incorrectly tried to put a constructor or destructor into the 'automated' section of a class declaration.
program Produce;
type
Base = class
automated
constructor HardHatBob;
destructor DemolitionBob;
end;
constructor Base.HardHatBob;
begin
end;
destructor Base.DemolitionBob;
begin
end;
begin
end.
It is not possible to declare a class constructor or destruction in an OLE automation section. The constructor and destructor declarations in the above code will both elicit this error.
program Solve;
type
Base = class
constructor HardHatBob;
destructor DemolitionBob;
end;
constructor Base.HardHatBob;
begin
end;
destructor Base.DemolitionBob;
begin
end;
begin
end.
The only solution to this error is to move your declarations out of the automated section, as has been done in this example.