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 / Working With Macintosh Memory Manager Handles


You use the FlattenCollectionToHdl utility function to flatten a collection into a Macintosh Memory Manager handle.

OSErr FlattenCollectionToHdl(Collection source
                             Handle flattened);
The collection that you want to flatten into a handle.
A handle to contain the flattened data.
This function flattens the collection referenced by the source parameter into a block of memory referenced by the handle you provide in the flattened parameter.

You must provide a valid collection object reference in the source parameter and a valid Macintosh Memory Manager handle in the flattened parameter. You may specify a handle of size 0; this function resizes the handle as necessary to hold the flattened data.

memFullErr-108Can't allocate memory.
For examples of this function, see "Reading Collections From and Writing Collections to Disk" beginning on page 5-41.

For an example that shows one possible implementation of this function, see "Flattening and Unflattening a Collection" beginning on page 5-37.

To flatten a collection directly to disk, use the FlattenCollection function, described on page 5-88.

To unflatten a collection from a block of memory referenced by a handle, use the UnflattenCollectionFromHdl function, described in the next section.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996