Multiple instance support can be controlled automatically for you. This is the recommended approach for Windows 3.1 due to the way memory is shared across multiple instances. This feature is not necessary for Windows 95 and Windows NT systems because these operating systems provide unique memory space to each process, unlike Windows 3.1. The #define ctPORTAUTOWIN enables automatic instance support. If this #define is used, the application is NOT required to call RegisterCtree(), SwitchCtree(), or UnRegisterCtree(). These functions will be called automatically.
However, it is still possible to manually call RegisterCtree, giving additional control by returning the pointer to the FairCom DB global structure, allowing pointers to be held locally. By having this pointer, you can print out the FairCom DB error variables, file number, etc.
Note: If you don’t desire to call RegisterCtree() manually, embedding WhichCtree() inside of a call to GetCtreePointer() can obtain the FairCom DB global structure pointer. See RegisterCtree and WhichCtree in the function reference section for additional information.
In summary, you only need to do two things to take advantage of this Automatic Instance Support for Windows 3.1 feature: