Important: The information in this document is obsolete and should not be used for new development.
Global Data Storage for Printing Extensions and Printer Drivers
Printing extensions and printer drivers are stand-alone code and do not enjoy the full status of an application. When an application is launched, a memory block is automatically allocated for the storage of globals. Unlike applications, stand-alone code is never launched. It is simply loaded, and therefore no memory for globals is allocated.As a result, if your printing extension or driver requires global data, it must allocate and deallocate memory for this data. Global data can be stored as a constant, a handle, a pointer, or in a so-called A5 world by the use of QuickDraw GX Message Manager functions. QuickDraw GX will not dispose of your globals for you. You must explicitly dispose of them yourself when you are done using them.
Each instance of a message handler can only see its data. If you want to limit access to one instance of your message handler's data, see the section "Setting and Getting Global Data for a Single Handler Instance" beginning on page 6-10.
If you want to use common global data that is accessible to all instances of your handlers, see the section "Setting and Getting Global Data for Multiple Handler Instances" beginning on page 6-12.
To create an A5 world that limits the access of your global data to one copy of your message handler, see the section "Allocating Memory for and Disposing of Global Data" beginning on page 6-8.
For more information about the A5 world, see Inside Macintosh: Memory.