Cannot get .NET winforms app to open to help topic in a CHM file

1.6k views Asked by At

I have a vb.net Winforms application. I also have a compiled help file (chm) file that I created using RoboHelp 6.0.

I want to open to a specific help topic and so to do that I am using the following code.

System.Windows.Forms.Help.ShowHelp(Me, "MyHelpFile.chm",HelpNavigator.KeywordIndex, "MyTopic")

Of course I am using variable instead of string literals ... work with me here ; / )

In this case the Help file opens to the Index in the left pane and the topic is selected in the Index pane but the right (Content) pane is showing the Main/First page of the help file...not my topic.

I have tried every combination from the HelpNavigator enum and none of them work. Only a few of them should work since most of them are not designed to open to a specfic topic...but for the ones that should work here is the result.

HelpNavigator.Topic - When I use this option I get the left pane opens to the TOC with everything collapsed and nothing selected. The right pane gives a standard IE error:

"This program cannot display the webpage 

   Most likely causes:
You are not connected to the Internet. 
The website is encountering problems. 
There might be a typing error in the address. 

   What you can try: 
     Check your Internet connection. Try visiting another website to make sure you are connected.  

     Retype the address.  

     Go back to the previous page. 

     More information "

HelpNavigator.TopicID - I cannot try because as far as I can tell my topics do not have Topic IDs.

Here are my questions -

Any ideas what is wrong? How can I troubleshoot help file issues? (For example, validate that the topic exists in the help file? I am sure it is in the source but it doesn't seem to find it in the compiled version. If you double click the topic in the index or TOC it opens just fine.)

My ideal solution would be to open the TOC in the Left pane with the topic selected (but I will settle for Index int the left pane) and the Right pane shows the Topic content.

Seth

2

There are 2 answers

3
Seth Spearman On BEST ANSWER

The following link has the explanation--

http://www.cmcandrew.com/robocolumn/the-perils-of-context-sensitive-help/

You have to add a map id and alias it to a topic.

Seth

0
Rick Strahl On

The problem is one of permissions.

If a help file was downloaded from the Web or comes from a Zip file that was downloaded from the Web, the file will be blocked which manifests with the behavior you describe: The content pane displays an error.

To fix this go into Explorer right click the CHM file, and then click on the Unblock option on the bottom right of the dialog.

To fix this problem correctly, you need to ensure you install the CHM file as part of an installation process which tells Windows that the file is safe to use. Avoid direct installation from a zip file of internet downloaded content into a folder.

More detailed info here:

http://weblog.west-wind.com/posts/2012/Jan/11/Problems-with-opening-CHM-Help-files-from-Network-or-Internet