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 / Collection Manager Reference
Functions / Reading Collections From Resource Files


GetNewCollection

Use the GetNewCollection utility function to read a collection in from a collection ('cltn') resource.

Collection GetNewCollection(short collectionID);
collectionID
The resource ID associated with the collection resource from which you want to create the new collection object.
function result
A reference to the new collection object.
DESCRIPTION
This function searches the current resource file path for a collection ('cltn') resource with the resource ID specified by the collectionID parameter. If it finds such a resource, this function creates a new collection object, initializes it with the information stored in the resource, and returns a reference to it as the function result.

If this function does not find a collection resource with the specified resource ID, it returns nil as the function result.

You can use the MemError and ResError functions to check for other errors after calling this function.

RESULT CODES
memFullErr-108Can't allocate memory.
resNotFound-192Resource not found.
SEE ALSO
For an example using this function, see "Reading a Collection From a Collection Resource" beginning on page 5-44.

For information about collection resources, see "The Collection Resource" beginning on page 5-102.

For more information about resources in general, see the "Resource Manager" chapter of Inside Macintosh: More Macintosh Toolbox.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996