Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Environment and Utilities /
Chapter 5 - Collection Manager / Using the Collection Manager


Determining Whether the Collection Manager Is Available

The Collection Manager is not available in all system software versions. Therefore, before calling any Collection Manager functions, you should use the Gestalt function to determine whether the Collection Manager is available. To get information about the Collection Manager, you pass the Gestalt function the gestaltCollectionMgrVersion selector, as shown in Listing 5-1.

Listing 5-1 Determining whether the Collection Manager is available

Boolean CollectionMgrExists(long versionRequired) {

   long collectionMgrVersion;

   Boolean exists = (Gestalt(gestaltCollectionMgrVersion,
                             &collectionMgrVersion) == noErr);
   if (exists)
      exists = (collectionMgrVersion >= versionRequired);
   return(exists);
}
In Listing 5-1, the CollectionMgrExists sample function uses the Gestalt function to determine whether the Collection Manager is available and, if so, which version is available. If the Collection Manager is available, this sample function tests whether the version number is sufficiently high by comparing it with a specified minimum.

You would call this sample function with a line of code such as

exists = CollectionMgrExists(0x01008000); /* version 1.0f0 */
You can find out more about the Gestalt function in the chapter "Gestalt Manager" of Inside Macintosh: Operating System Utilities.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996