Looking up topics in a child chm file

Discussions about Help+Manual 9

Moderators: Alexander Halser, Tim Green

Post Reply
User avatar
Robert van der Hulst
Posts: 45
Joined: Thu Jul 25, 2002 10:12 am
Contact:

Looking up topics in a child chm file

Unread post by Robert van der Hulst »

I have a main project (which produces XSharp.chm) with a child project (XsharpRef.chm) that is generated by another tool.
From C# code I try to show a help topic and show the TOC opened on the right location next to it.

That works with

Code: Select all

Help.ShowHelp(null, fileName, HelpNavigator.Topic, topicFileName);
When I pass the name of the chm file of the child project and the topicFileName then it works.
When I pass the name of the chm file of the main project, and prefix the filename of the topic from the child chm with "ms-its:XSharpRef.chm::/" then the topic is opened correctly, but the TOC does not open at the same location. The TOC stays at the top entry.
Is there a way to open the TOC at the right location too ?

Robert
User avatar
Alexander Halser
EC-Software Support
Posts: 4098
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: Looking up topics in a child chm file

Unread post by Alexander Halser »

I vaguely remember this as an old issue with merged CHM files. Not sure if it can be solved at all.

When you open a context sensitive topic in a CHM file, the TOC is internally synced by the viewer. This sync method is pretty basic: it iterates the TOC top-down and highlights the first TOC entry that matches the topic you have opened in the content pane. If there is no match, the TOC selection remains unchanged.

I guess this is what happens in your case: the TOC entries in "XShapeRef.chm" contain links to the internal topic pages without any path or with a relative path. By specifying the full path of the child file in the topic name (clever trick, by the way), it does not find a matching TOC entry and therefore does not sync it.

One thing that comes to my mind to (possibly, not tested) overcome the limitation, would be help context IDs. Does "XShapeRef.chm" have context numbers? If yes, try to open the target topic by context ID. If you do not know whether "XShapeRef.chm" contains context numbers, import this file with Help+Manual into a new project and check the context number associations in H&M.

The second thing to consider is a global help window name.
See https://www.helpandmanual.com/help/hm_a ... ethod.html for details.

For additional tips and tricks on merged CHM files, please have a look at this page:
http://kb.helpwaregroup.com/ms-html-hel ... extHelpIDs

A quote from this page:
Also Marc Islam (MSFT) points out that you must use $Global_ if you want TOC auto-sync to work correctly.
Alexander Halser
Senior Software Architect, EC Software GmbH
Post Reply