Important: The information in this document is obsolete and should not be used for new development.
OpenComponentResFile
TheOpenComponentResFilefunction allows your component to gain access to its resource file. This function opens the resource file with read permission and returns a reference number that your component can use to read data from the file. The Component Manager adds the resource file to the current resource chain. Your component must close the resource file with theCloseComponentResFilefunction before returning to the calling application.Your component can use
FSpOpenResFileor equivalent Resource Manager routines to open other resource files, but you must useOpenComponentResFileto open your component's resource file.
FUNCTION OpenComponentResFile (aComponent: Component): Integer;
aComponent- A component identifier that specifies the component whose resource file you wish to open. Applications that register components may obtain this identifier from the
RegisterComponentResourcefunction.DESCRIPTION
TheOpenComponentResFilefunction returns a reference number for the appropriate resource file. This function returns 0 or a negative number if the specified component does not have an associated resource file or if the Component Manager cannot open the resource file.Note that when working with resources, your component should always first save the current resource file, perform any resource operations, then restore the current resource file to its previous value before returning.