Nemo
2010-02-03 22:41:14 UTC
In our application we wanted the ability to create CHM files. ( the
application isn't a help system generator itself, we just want to generate
help files as an "extra" for the user ). At various points in the
application the user is allowed to browse/select HTML/HTM files on thier
machine. When the user publishes, we use the HTML/HTM files to generate a
CHM. The application creates a project file and a map file in a temp dir to
generate the CHM. We convert all the absolute paths to the accumulated
HTML/HTM files to relative paths(relative to the temp dir with the project
file). An example of the project file looks like
[OPTIONS]
Binary Index=No
Compatibility=1.1 or later
Compiled file=alpha2.chm
Default topic=..\..\..\..\..\Help\SpecialAdd.html
Display compile progress=Yes
Enhanced decompilation=Yes
Language=0x409 English (United States)
[FILES]
..\..\..\..\..\Help\SpecialAdd.html
..\..\..\..\..\SecondHelp\SpecialDel.html
[ALIAS]
TEST_1000=..\..\..\..\..\Help\SpecialAdd.html
TEST_1001=..\..\..\..\..\SecondHelp\SpecialDel.html
[MAP]
#include Map.h
[INFOTYPES]
and map file looks like
#define TEST_1000 1000
#define TEST_1001 1001
we then run the hhc.exe( setting the working dir as the temp directory) and
generate the CHM. The project compiles correctly and gives no errors and
produces the requested CHM.
However when we attempt to load a specfic topic using the ID such as
hh -mapid 1001 alpha2.chm
it always gives the "This program cannot display the webpage" error in the
help window, when we would expect to see the SpecialDel.html displayed.
When alpha2.chm is decompiled it correctly extracts all the html/html and
images required, thus they are present in the CHM. If we replace the
relative paths with the absolute paths, it results in the same bad behavior.
However if we put all the html and images into the temp dir so everything is
referenced locally and create a CHM, running hh -mapid 1001 alpha2.chm,
does show the specialdel.html correctly. Thus is must be related to the
paths provided in the [FILES] and [ALIAS] sections. I have been searching
for a solution to this issue but have not found any leads in the MS
documentation on rules for the paths. The only reason we use relative paths
is because HTML Workshop also uses relative paths. If we do the equilivant
steps above using HTML workshop, we get the same bad results. (no big shock
since it uses hhc.exe too)
We are using version 4.74.8702.0 on Vista.
Any help is appreciated.
application isn't a help system generator itself, we just want to generate
help files as an "extra" for the user ). At various points in the
application the user is allowed to browse/select HTML/HTM files on thier
machine. When the user publishes, we use the HTML/HTM files to generate a
CHM. The application creates a project file and a map file in a temp dir to
generate the CHM. We convert all the absolute paths to the accumulated
HTML/HTM files to relative paths(relative to the temp dir with the project
file). An example of the project file looks like
[OPTIONS]
Binary Index=No
Compatibility=1.1 or later
Compiled file=alpha2.chm
Default topic=..\..\..\..\..\Help\SpecialAdd.html
Display compile progress=Yes
Enhanced decompilation=Yes
Language=0x409 English (United States)
[FILES]
..\..\..\..\..\Help\SpecialAdd.html
..\..\..\..\..\SecondHelp\SpecialDel.html
[ALIAS]
TEST_1000=..\..\..\..\..\Help\SpecialAdd.html
TEST_1001=..\..\..\..\..\SecondHelp\SpecialDel.html
[MAP]
#include Map.h
[INFOTYPES]
and map file looks like
#define TEST_1000 1000
#define TEST_1001 1001
we then run the hhc.exe( setting the working dir as the temp directory) and
generate the CHM. The project compiles correctly and gives no errors and
produces the requested CHM.
However when we attempt to load a specfic topic using the ID such as
hh -mapid 1001 alpha2.chm
it always gives the "This program cannot display the webpage" error in the
help window, when we would expect to see the SpecialDel.html displayed.
When alpha2.chm is decompiled it correctly extracts all the html/html and
images required, thus they are present in the CHM. If we replace the
relative paths with the absolute paths, it results in the same bad behavior.
However if we put all the html and images into the temp dir so everything is
referenced locally and create a CHM, running hh -mapid 1001 alpha2.chm,
does show the specialdel.html correctly. Thus is must be related to the
paths provided in the [FILES] and [ALIAS] sections. I have been searching
for a solution to this issue but have not found any leads in the MS
documentation on rules for the paths. The only reason we use relative paths
is because HTML Workshop also uses relative paths. If we do the equilivant
steps above using HTML workshop, we get the same bad results. (no big shock
since it uses hhc.exe too)
We are using version 4.74.8702.0 on Vista.
Any help is appreciated.