---
title: RegisterComponentResourceFile
framework: Core Services
role: symbol
role_heading: Function
platforms: [macOS 10.0+]
path: coreservices/1516511-registercomponentresourcefile
---

# RegisterComponentResourceFile

Registers all component resources in the given resource file.

## Declaration

```occ
SInt32 RegisterComponentResourceFile(SInt16 resRefNum, SInt16 global);
```

## Parameters

- `resRefNum`: The reference number of the resource file containing the components to register.
- `global`: A set of flags that control the scope of the registration of the components in the resource file. See [doc://com.apple.documentation/documentation/coreservices/1516405-register_component_resource_flag](coreservices/1516405-register_component_resource_flag.md) for a description of the flags.

## Return Value

The number of components registered, if all components in the specified resource file are successfully registered. If one or more of the components in the resource file could not be registered, or if the specified file reference number is invalid, a negative function result. 

## Discussion

Before a component can be used by an application, the component must be registered with the Component Manager. The Component Manager automatically registers component resources stored in files with file types of `'thng'` that are stored in the Extensions folder. For a description of the format and content of component resources, see “Resources”.  

## See Also

### Registering Components

- [RegisterComponent](1516537-registercomponent.md)
- [RegisterComponentResource](1516594-registercomponentresource.md)
- [UnregisterComponent](1516645-unregistercomponent.md)
- [RegisterComponentFileRef](1516564-registercomponentfileref.md)
- [RegisterComponentFileRefEntries](1516395-registercomponentfilerefentries.md)
