Xml.XMLDoc.TXMLDocument.NewInstance
Delphi
class function NewInstance: TObject; override;
C++
__classmethod virtual System::TObject* __fastcall NewInstance();
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | Xml.XMLDoc.pas Xml.XMLDoc.hpp |
Xml.XMLDoc | TXMLDocument |
Description
Allocates memory for an instance of an object type and returns a pointer to that new instance.
Xml.XMLDoc.TXMLDocument.NewInstance inherits from System.TObject.NewInstance. All content below this line refers to System.TObject.NewInstance.
Allocates memory for an instance of an object type and returns a pointer to that new instance.
All constructors call NewInstance automatically. NewInstance calls InstanceSize to determine how much memory containing a particular instance to allocate from the heap. Do not call NewInstance directly.
Override NewInstance only for special memory allocation requirements. For example, when allocating a large number of identical objects that all need to be in memory at the same time, you can allocate a single block of memory for the entire group, then override NewInstance to use part of that larger block for each instance.
If you override NewInstance to allocate memory, you may need to override FreeInstance to deallocate the memory.
Note: By default, NewInstance calls InitInstance.