The ctNOGLOBALS define, default in c-tree, places all c-tree global variables in an allocated c-tree global control structure, ctWNGV. This is handled invisibly in most c-tree models and should not interfere with the normal operation of your application.
If your application uses multiple instances or threads, a more detailed understanding of the global structures is required. See Multiple Instance Support and Multi-threaded API for more information.
Basics
FairCom DB ctNOGLOBAL support, defined by default, places all FairCom DB global variables in an allocated structure, the FairCom DB global control structure, ctWNGV. This logic was originally developed for two primary purposes:
When a FairCom DB initialization call is made, FairCom DB checks to see if the structure has been allocated by the application. If the structure has not been allocated, FairCom DB allocates the structure automatically. If additional instances are necessary, use the instance functions listed below. If a pointer is needed to the global structure, declare ctWNGV in your application and set it to the current instance with:
ctWNGV = (cCTGVAR) GetCtreePointer((pTEXT) WhichCtree());
RegisterCtree() |
Register an instance to FairCom DB. |
UnRegisterCtree() |
Unregister an instance from FairCom DB. |
SwitchCtree() |
Make the supplied registration ID active. |
NextCtree() |
Change to the next registered instance. |
WhichCtree() |
What is the current FairCom DB instanceID. |
These functions are described in the function reference section. For examples of this feature, see the Windows samples wtixmg and wtlxmg.
Multiple Instance support is replaced by the thread management API when using the multi-threaded FPUTFGET and client libraries.