Category Archives: Ebook

This program cannot display the webpage when reading a CHM file?

“This program cannot display the webpage”

What is the reason?

And I mean besides the fact your chm file may be residing somewhere other than locally on the machine. or the fact that you did copy it locally already, but you did not yet use the Unblock button in the Properties dialog of the file?
Yes, besides that. Well, another cause may be that your chm file is stored in a folder that contains a “#” or maybe the file itself has a name that contains a “#” like in “C#”.

[Excerpt from Dr. EXplain at http://www.drexplain.com/press/chm-files-the-page-cannot-be-displayed-error/ :
Many C# developers discovered that their documentation and e-books in CHM format cannot be read because they were storing their CHM files in the directories like 'C:\E-books\C#\' The hash character signifies an anchor in HTML so the CHM viewer fails to resolve the path properly and to retrieve the content. Solution: Remove the '#' (hash) character from the directory name. Also avoid using '?', '&', and '+' characters in directory names. ]

But what if you did all the above and you still cannot read the content of the CHM file. What the original post linked above is missing is that of course having a “#” in the file name itself renders the chm file unreadable. (and this time you will only see a white page in the right panel).

But there’s another reason which is not obvious at all and it is caused by the fact Microsoft plugged some serious security holes in the protocol used for reading CHM documents.
The registry hacks provided by Microsoft at the time didn’t work an all systems especially Windows XP post SP2. Regardless of setting the “HKLM\Software\Microsoft\HTMLHelp\1.x\ItssRestrictions\MaxAllowedZone” to the highest value you still could not open chm files from the network. This was because of the way Internet Explorer 6.0 handles temporary Internet files and the fact hh.exe (the CHM reader) uses a subsystem of IE to open these files.
When these files are comming from outside of the local machine they are deposited in a temporary location which was deemed as mixed zone:local and Internet. Probably because it could not interpret correctly what zone it is in it was simply not displaying the page.
This was fixed in IE 7 at least the Vista version. I just tried the hack again and I was pleasantly surprised to see that it allows opening my chm files from the intranet.

Anyway, just to be sure you get it right, the key you`re looking for is “HKLM\Software\Microsoft\HTMLHelp\1.x\ItssRestrictions”
If you don`t have this key in your registry please create it and then add a DWORD to this key, called MaxAllowedZone. The implicit value for this entry is 1 which leads to the behavior where you can`t open chm files properly from Intranet or Internet. You can try various values but I went directly and used 4. Next thing you know, the chm document opened from the network just fine.

See this KB article for a more detailed description

Cheers.

Follow

Get every new post delivered to your Inbox.