Platform Package reference: Function EwNewObject()
Description of the function EwNewObject() available in all Platform Packages for C compatible target systems. This function is intended to be used when integrating the Embedded Wizard created GUI application with the underlying graphics subsystem, graphics hardware or other external GUI applications coexisting on the same system.
Declaration
object‑of‑class 'aClassName' EwNewObject( aClassName, XHandle aReserved )
Parameters
aClassName
Identifier specifying the desired class to create a new object instance. The identifier is composed from the name of the unit and the name of the class.
aReserved
Reserved parameter. Should be 0 (zero).
Discussion
The function EwNewObject() implements the Chora new operator. EwNewObject() allocates memory for a new instance of the specified class name aClassName and initializes the object properly. For example, to create an instance of the class Example::Application, following code can be used:
ExampleApplication object = EwNewObject( ExampleApplication, 0 );
The created object will remain in memory as long as the object is in use. Objects, which are not in use anymore are automatically released during the next EwReclaimMemory() invocation.