Links to another .chm file not working

This is the place to discuss Help & Manual 4 issues. Please don't post questions on any other versions here!

Moderators: Alexander Halser, Tim Green

Post Reply
karent
Posts: 9
Joined: Thu Nov 11, 2010 4:14 pm

Links to another .chm file not working

Unread post by karent »

I'm a new user of 4.5.1. When I create a hyperlink to another .chm file (File Link option in the Hyperlink dialog), it works--except when the .chm file containing the link is called from within my company's product. I've tested the link in the Help folder where the product is installed, and the link works there. It's just broken when called from within the program. I've checked the help calls, and they look fine. Any ideas? BTW, hyperlinks to a URL work fine when called from within the product.

Using the previous version of H&M, our writers had to use the Javascript option to create file-to-file links. They worked when called from our program. But if I can use the easier way, I'd much prefer that!

Is there a way to make this work without going back to the Javascript method? Or involving our programmers? They're already too busy.

Thanks,
Karen Todd
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Links to another .chm file not working

Unread post by Tim Green »

Hi Karen,

Just to be clear: Are you trying to make a two-stop call, i.e. a call to a link in one CHM that then calls a link to another CHM? If that's the case, it won't work. The Microsoft CHM Viewer doesn't route calls like that. You need to make the call directly to the CHM containing the target. If that's not what you're doing we need a little more information to be able to provide a meaningful answer. 8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
karent
Posts: 9
Joined: Thu Nov 11, 2010 4:14 pm

Re: Links to another .chm file not working

Unread post by karent »

No, I'm just trying to do a regular File Link. It is very strange that it works everywhere I've tested it except when called by the product. I've asked the programmer if he can think of a reason, and he said no.

So here's what happens: using the Hyperlink dialog, I click the File Link, find the destination file, and insert a link in TopicA.hmx to TopicB.hmx. I compile as usual, to .chm files. I then copy both TopicA.chm and TopicB.chm into the Help folder of our company's product, the way we always do to test our help files.

If I open the Help folder outside of the product and click on the link in TopicA, TopicB opens up correclty. However, if I click on the interface and press F1 to bring up the help and then click on the link in TopicA, I get an error message.

I hope this is enough information. Our work-around with earlier H&M versions has been to use the Javascript option in the Hyperlink dialog, which worked but was very tedious. I had hoped that version 4.5.1 would solve that problem.

Any ideas?

Thanks,
Karen Todd
DHI Computing Service
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Links to another .chm file not working

Unread post by Tim Green »

Hi Karen,

Ah, now I know immediately what the problem is: You are running up against one of the two more famous bugs (there are many others...) in the Microsoft CHM viewer: The relative path bug and the current folder bug. This one is the current folder bug. What is happening is that your application is setting the current folder, and that is not the folder containing the CHM files. Because of this bug (which has existed since Windows 98 and which Microsoft clearly does not intend to ever fix), CHM files can only "see" other files in the same folder if that folder is set as the current folder.

Either your programmers can set the current directory to the folder containing the CHM files, or you can improve resilience to the current directory bug by registering your CHM files. This should be part of your installation procedure, as it makes it much more likely that CHM files can be found and can find each other, even if their directory is not currently the current directory.

Register HTML Help files here:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\HTML Help

To register a file create a new string value where the name is the name of the help file to be registered (with extension but without path) and the value is the path alone. If you take a look at these registry keys you will find plenty of examples there of help files that are already registered. You can also register files with EC Software's free HHReg tool, which you can download here:

http://www.ec-software.com/products_hhreg.html

HHReg is primarily designed for solving problems with running CHMs on networks but it can also be used to register them. It has a silent command line mode and can be integrated in your install process.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
cindynotbrady
Posts: 157
Joined: Wed Mar 01, 2006 3:49 pm
Location: Provo, Utah

Re: Links to another .chm file not working

Unread post by cindynotbrady »

I tried what you suggested, and it took me on the original problem. The first time I tried registering the chms, it looked like it worked. But now when I try it, the link has stopped working. So Microsoft must be getting smart to that workaround.

Can you refer me to any links that discuss in more detail about the "current folder bug"? I found this from another topic, and I'm confident this is what I'm dealing with:
"You are running up against one of the two more famous bugs (there are many others...) in the Microsoft CHM viewer: The relative path bug and the current folder bug. This one is the current folder bug. What is happening is that your application is setting the current folder, and that is not the folder containing the CHM files. Because of this bug (which has existed since Windows 98 and which Microsoft clearly does not intend to ever fix), CHM files can only "see" other files in the same folder if that folder is set as the current folder.

Either your programmers can set the current directory to the folder containing the CHM files, or you can improve resilience to the current directory bug by registering your CHM files. This should be part of your installation procedure, as it makes it much more likely that CHM files can be found and can find each other, even if their directory is not currently the current directory."
What is meant by "set the current directory to the folder containing the CHM files"? This is the part I need to share with the programmers. Does it have to do with code behind how the <F1> key works?
User avatar
cindynotbrady
Posts: 157
Joined: Wed Mar 01, 2006 3:49 pm
Location: Provo, Utah

Re: Links to another .chm file not working

Unread post by cindynotbrady »

Sorry. This was supposed to go in another post. You can answer it here or here: http://helpman.it-authoring.com/viewtop ... 30&t=12979
Post Reply