company logo

Create a resource reference and associate context class

In order to link a complex data type or property within a complex data type (object model resources) to a context class, a resource reference has to be created for the object model resource, which provides a unique resource identifier (number). This is the minimum required for creating proper context class instances later in the application.

When a database resource is opened, it passed the resource reference number ( __AUTOIDENT ) to the CreateContext() function, which has to be provided by the library containing the context class implementations. Any number of resources can be associated with one context class.

Context classes can be assigned in the ClassEditor tool ( Quick Starter Guide / 9 steps to develop a GUI application ) , which also generates link tables between context class name and resource identifier. Those are compiled in a C function ( CreateContext() ), which creates context class instances for complex and property instances, which are linked to a context class.

When not using the ClassEditor, the CreateContext() function has to be defined manually in the application. The application below shows one possible way of implementing the function ( ClassEditor generation). All resources to be linked with a context class.

Notes:

Of course, all this might be done manually, but than you have to to learn a lot about object links and programming conventions. Thus, we suggest using the ClassEditor for creating database model resource context classes.