HTMLRes User Guide

Introduction

HTMLRes is a simple command line application that creates 32 bit binary resource files that contain HTML files suitable for displaying using Internet Explorerís res:// protocol. For details on how to use the protocol see this article.

The application simply takes a list of HTML and related support files and embeds the files a RT_HTML section of a resource file. The resource file is created from scratch. (Warning: any exisiting resource file with the same name is overwritten).

Command Line

The command line syntax of the application is:

HTMLRes in-file-list [-mmanifest-file] [-oout-file] [switches]

where:

At least one input file must be provided, either directly on the command line or in the manifest file unless the -H, -h or -? switches are used.

Only the base file name is used as a resource name (i.e. path information is stripped out). Therefore each file name used must be unique, regardless of the path.

Error codes

The program returns 0 on success or an explanatory error code on failure. The error codes are:

Error code Explanation
1 command line error
2 manifest file doesn't exist
3 one or more source files don't exist
4 duplicate resource name (file name)
255 unexpected / unknown error

Example

An example Delphi project is supplied with the program. The demo files are installed in the Demo folder).

The demo project simply creates a resource only DLL that stores some HTML, CSS and GIF files that can be displayed in Internet Explorer.

The demo files are:

Before building the demo project using Delphi you must first start a command window (DOS box) and navigate to the demo directory. Now run HTMLRes as follows:

HTMLRes -mDemo.hmfst -oHTML.res

This compiles the files specified in Demo.hmfst into the resource file HTML.res.

The project file, HTMLLib.dpr, contains a resource statement that includes HTML.res. The project can now be compiled with Delphi to create the required resource DLL.

If the demo DLL is stored in the C:\Program Files\DelphiDabbler\HTMLRes\Demo folder we can display the main page in Internet Explorer by entering the following URL in the address bar:

res://C:\Program Files\DelphiDabbler\HTMLRes\Demo\HTMLLib.dll/index.html

The HTML file, its style sheet and the graphic are all stored in the DLL's resources along with a second page that can be displayed by clicking the link on the index page.

Uninstalling HTMLRes

If you wish to uninstall the HTMLRes please use the Windows Control Panel Add/Remove programs applet. A few residual files may be left behind in the installation folder ([Program Files]\DelphiDabbler\HTMLRes by default where [Program Files] is your system's default program installation folder). These files, and the installation folder can safely be removed manually.

Copyright, license and disclaimer

This program us copyright © 2004 by Peter Johnson, Llanarth, Ceredigion, Wales, UK. It is released under the Mozilla public license v1.1. See the file License.txt included with this distribution for further details.

No warranty is provided with this program and it is used entirely at your own risk. The author cannot be held liable for any loss or damage that results from using this program.

Privacy and security

HTMLRes makes no attempt to access the internet and nor does it try to access any personal information on your computer. If you notice any unexpected network activity while using the program then it is likely that the executable has become infected by a virus or other mal-ware.

Please notify the author if any unusual behavior is detected (see the "Feedback" section below for contact details).

Feedback

Your feedback is welcome. If you have any comments, queries, bugs to report or requests for new features please contact the author via his website.