E2459 Delphi style classes must be constructed using operator new (C++)

From RAD Studio
Jump to: navigation, search

Go Up to Compiler Errors And Warnings (C++) Index

Delphi style classes cannot be statically defined. They have to be constructed on the heap. Delphi style classes derive directly or indirectly from System::TObject.


Example:

voidfoo(void)
{
     Tobject   o1;     // Error;
     Tobject  *o2 = new TObject();
}