Important: The information in this document is obsolete and should not be used for new development.
OpenComponentResFile
TheOpenComponentResFile
function 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 theCloseComponentResFile
function before returning to the calling application.Your component can use
FSpOpenResFile
or equivalent Resource Manager routines to open other resource files, but you must useOpenComponentResFile
to 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
RegisterComponentResource
function.DESCRIPTION
TheOpenComponentResFile
function 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.