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: More Macintosh Toolbox /
Chapter 6 - Component Manager / Using the Component Manager


Closing a Connection to a Component

When you finish using a component, you must close your connection to that component. Use the CloseComponent function to close the connection. For example, this code calls the application-defined procedure MyDrawAnOval (see Listing 6-4), which opens a connection to a drawing component and uses that component to draw an oval. This code closes the oval drawer component after it is finished using it.

VAR
   aDrawOvalComp: ComponentInstance;
   result:        OSErr;

MyDrawAnOval(aDrawOvalComp);     {open component and draw an oval}
result := DrawerErase(aDrawOvalComp);  {erase the oval}
result := CloseComponent(aDrawOvalComp); {close the component}

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996