[Overview][Resource strings][Constants][Types][Classes][Index] | Reference for unit 'resource' (#fcl-res)

# TResources.RegisterWriter

Registers a resource writer class

## Declaration

Source position: resource.pp line 273

`public class procedure TResources.RegisterWriter(`
`const aExtension: string;`
`aClass: TResourceWriterClass`
`);`

## Arguments

`aExtension` |  | The extension for which the class must be registered
`aClass` |  | The TAbstractResourceWriter descendant to register

## Description

This class method registers a resource writer class.

When registered, a class is known to TResources class, and can be used by WriteToFile method when probing.

Usually this method is called in the initialization section of the unit implementing a TAbstractResourceWriter descendant.

A class can be registered multiple times, one for each extension it is able to write. Multiple class can be registered for the same extension (e.g. both a coff and a elf writer can be registered for the .o extension) although only the first one found will be used when probing. The extension must include the leading dot unless the empty string is used (which means "no extension", e.g. a unix executable, which doesn't have an extension).

## See also

TAbstractResourceWriter |  | Base abstract resource writer class
TResources.WriteToFile |  | Writes the contents of the object to a file