Carilda
Carilda

Reputation: 161

MS Help - hhc fails on compiling an HTML file while building .chm

I'm converting a WinHelp to html help using HTML Workshop and HHMod but there are some errors. Some files have been discarded, I'm guessing because the titles were duplicates (although the keys were different). But for this problem: .hhp wants a default file so I created a "html/empty.htm" by copying an existing (and valid) .htm file. This is a placeholder for items in the index that are just books to open. However, when trying to build the .chm, I get:

HHC5003: Error: Compilation failed while compiling empty.htm

The other 3000+ files compile just fine but they were created by the tools. Here is the .htm file that I created by hand:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<TITLE>CIS Help</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">

<OBJECT TYPE="application/x-oleobject"
    CLASSID="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
    <PARAM NAME="Keyword" VALUE="CIS HELP">
</OBJECT>

<H1><CODE><A NAME="CIS HELP"></A>CIS Help</CODE></H1>

<pre><code>Press the "+" sign to expand the book.
</code></pre>
</BODY>
</HTML>

Here is the snippet in the toc file (.hhc) that refers to this .htm:

<LI><OBJECT type="text/sitemap">
    <param name="Name" value="CIS HELP">
    <param name="Local" value="html/empty.htm">
    </OBJECT>

    <A HREF="html/empty.htm">CIS Help </A><BR>

(The toc goes on to define a number of UL layers below this.)

It's probably something obvious but I haven't been able to google any references on how to create a valid .htm file for .chm. Please note that I am a newbie to MS although not to programming.

Upvotes: 2

Views: 2785

Answers (1)

Carilda
Carilda

Reputation: 161

For anyone else who runs into this problem: Apparently, the stumbling block is using a file as a "default file" - HTML Help seems to automatically use the first file in the list as its default file but if you specify one, it chokes. The docs I could find say that this happens if the default is used some unknown number, x, of times and that x may == 256. Unfortunately, x is probably a lot smaller since I don't have 256 items with no associated topic.

Upvotes: 2

Related Questions