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.

Advertisements

How to create a shortcut on the User’s Desktop in a Setup Project in Visual Studio 2008

I don’t know about other people’s Visual Studio 2008 installations but I had a bit of rough time with the Setup Project in mine.

I am not going to bother you with all I have been through. Long story short, when I tried to create a shortcut in either the User’s Desktop or User’s Program menu the behaviour of the File System view was disconcerting. And that, because whenever I right clicked on one of those folders in the tree view and chose "Create Shortcut To …" I could not see the shortcut in the right pane. They kept disappearing in thin air. And every time I attempted to create a new one I could see the new proposed name ending in an each time incremented number. They were there but invisible and kept piling up. Later somehow they showed up and I was able to see them but I don’t know how.

This weirdness happens only within the tree view because if you do the same thing by right clicking on any of those folders mentioned above but in the right panel you get the shortcut and when done setting its properties you can actually see it in the right panel.

Now, how you actually get a shortcut that points to your installed executable?
You go to the Application folder where I assume you already added a "Primary output from your_application (Active)" entry. You right click on this entry and create a shortcut to it. Then , you copy this shortcut (usually) to the "User’s Desktop" and "User’s Program Menu" so upon installation the user will get a shortcut on the Desktop and another one in the Start\Programs menu.