#
Resource File Unit
ReadMe

## Description

This unit contains classes that encapsulate Windows 32 bit binary resource files and the resources contained in them. The main functionality is provided by two classes:

- TPJResourceFile – encapsulates the contents of a whole resource file and provides methods and properties for reading, finding, editing, adding and deleting resources. Resource files can be read from and written to files or streams.
- TPJResourceEntry – encapsulates a single resource within the file and provides properties to access its header record and its raw data. The class also has methods to check the identity of the resource. The resource's raw data is accessible both as an array of bytes and via a TStream interface.
  This class has no knowledge of resource data formats and sees the data simply as a raw sequence of bytes. It is for the user of the class to interpret the data correctly.

In addition to the two main classes, some helper functions, constants and an exception class are also provided.

The unit is maintained as part of the Delphi Dabbler Code Library project on GoogleCode.

## Compatibility

The unit has been tested on Delphi 7, 2006 to 2010 and XE to XE4. It is believed to work with compilers back to Delphi 4, but this has not been tested in the current release.

The unit is compatible with the Delphi 32 bit and 64 bit Windows compilers. Because resource files are Windows specific the unit is not compatible with non-Windows platforms.

The unit is not dependent on the VCL or on FireMonkey, so can be used with or without either library.

## Installation

The Resource File Unit and documentation are supplied in a zip file. Before installing you need to extract all the files from the zip file, preserving the directory structure. The following files will be extracted:

- `PJResFile.pas` – Main source code.
- `ReadMe.htm` – This file.
- `ChangeLog.txt` – The project's change log.
- `MPL-2.txt` – Mozilla Public License v2.0.
- `Documentation.url` – Short-cut to the online documentation.

There are three possible ways to use the unit.

1. The simplest way is to add `PJResFile.pas` to your projects as you need it.
2. To make the unit easier to re-use you can either copy it to a folder on your Delphi search path, or add the folder where you extracted the unit to the Delphi Search path. You then simply use the unit as required without needing to add it to your project.
3. For maximum portability you can add the unit to a Delphi design time package. If you need help doing this see here.

## Documentation

All the classes and routines in the Resource File Unit are documented comprehensively online.

## Demo Code

No demo programs are included in the download. However there are numerous worked examples available as part of the online documentation. There is a link to the examples on the documentation landing page.

## Update History

A complete change log is provided in the file `ChangeLog.txt` that is included in the download.

## License and Disclaimer

The Resource File Unit (`PJResFile.pas`) is released under the terms of the . Mozilla Public License v2.0.

All relevant trademarks are acknowledged.

## Bugs and Feature Requests

Bugs can be reported or new features requested via the Issue Tracker.

If no similar report or request has been recorded already, use the New Issue link to add a new issue. Please select the most appropriate template from the Templates drop down list and change the `Project-unspecified` label to `Project-resfile`.

## About the Author

I'm Peter Johnson – a hobbyist programmer living in Ceredigion in West Wales, UK, writing write mainly in Delphi. My programs and code are available from: http://www.delphidabbler.com/.

I can be contacted via the website.

Please let me know if you have any comments about the classes, but please use the Issue Tracker above to report bugs and request new features.
This document is copyright © 2010-2014, P D Johnson, www.delphidabbler.com.