Important: The information in this document is obsolete and should not be used for new development.
Closing a Connection to a Component
When you finish using a component, you must close your connection to that component. Use theCloseComponent
function to close the connection. For example, this code calls the application-defined procedureMyDrawAnOval
(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}