Platform Package reference: Function EwNewObjectIndirect()

Description of the function EwNewObject() available in all Platform Packages for ANSI 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

XObject EwNewObjectIndirect( XClass aClass, XHandle aReserved )

Parameters

aClass

Pointer to a data structure representing the class of the object to create.

aReserved

Reserved parameter. Should be 0 (zero).

Discussion

The function EwNewObjectIndirect() implements the Chora new operator. EwNewObject() allocates memory for a new instance of the specified class aClass and initializes the object properly. For example:

XClass  someClass = ...
XObject object    = EwNewObjectIndirect( someClass, 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.