Platform Package reference: Function EwGetAutoObject()
Description of the function EwGetAutoObject() 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
XObject EwGetAutoObject( const XVariant* aAutoObject, XClass aClass )
Parameters
aAutoObject
Pointer to a data structure representing the autoobject to access. This data structure and all associated contents are generated by Embedded Wizard.
aClass
Pointer to data structure representing the class of the autoobject to access. The specified class has to match with the class defined originally in the autoobject member.
Discussion
The function EwGetAutoObject() returns an autoobject identified by aAutoObject. The function verifies whether the required object is already instantiated and if it's true, the existing instance is returned immediately. If no instance of the desired autoobject could be found, EwGetAutoObject() prepares a new object of the class aClass and initializes it properly. For example:
ApplicationDeviceClass device = EwGetAutoObject( &ApplicationDeviceObject, ApplicationDeviceClass );
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.