Anchor links do not work in CHM when published server-side

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
Rob van Haarst
Posts: 4
Joined: Thu Feb 05, 2015 2:58 pm

Anchor links do not work in CHM when published server-side

Unread post by Rob van Haarst »

We are using Help and Manual 7 server edition.
In a help topic, I have links jumping to anchors within the same topic.
We have a problem publishing these anchor jumps to the CHM format.
If I use the Publish button to publish from my local computer to a local .CHM file, and then run the .CHM file, the anchor jumps work correctly.
If I have these published by a nightly batch on the server side, the anchor links in the resulting .CHM file do not work (even after the file is distributed to the local file system of my computer).
Error: Can't reach this page - Make sure the web address //ieframe.dll/dnserrordiagoff.htm# is correct.
Except for the anchor links, the server-produced .CHM file is fully functional, including links-to-topics (as opposed to links-to-anchors).
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Anchor links do not work in CHM when published server-si

Unread post by Tim Green »

Hi Rob,

This is normal and intended by Microsoft. Actually, CHM should not be working at all on your server. That is the intended functionality by Microsoft. Ever since Windows XP SP1 CHM has been blocked in all external locations and is only supported on local drives. It used to be possible to get around this with a Windows Registry hack but this now only works on 32-bit Windows. It has been blocked completely and permanently on all 64-bit Windows, and since that is now the standard CHM must now be treated as a local format only.

Programmers can solve the problem by adding code to their applications to make a local copy of the CHM file on the user's computer and then making their help calls to this copy. We have been doing this for years with the server version of Help & Manual and it works very well.

However, since H&M makes it very easy to publish the same project to both CHM and WebHelp (it's just a question of selecting a different output format when you compile) it's no problem to produce different version for each scenario: HTML Help for help that must be installed on local computers and WebHelp for help on networks.

In Help+Manual 7 you also have the option of using the new EWriter format, which combines the benefits of CHM and WebHelp and eliminates the disadvantages of both:

https://www.helpandmanual.com/help/inde ... writer.htm
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.
Rob van Haarst
Posts: 4
Joined: Thu Feb 05, 2015 2:58 pm

Re: Anchor links do not work in CHM when published server-si

Unread post by Rob van Haarst »

Hi Tim,

Thanks very much for your informative reply. I am still figuring out what it means for our situation. The options you mention don't seem to apply to us.
I suppose that in your alinea "Programmers...", by "make a local copy" you mean: execute a command that calls the helpman.exe on the server and that will publish .CHM to a "C:\..." output path. But in our situation we must publish nightly to a server dir, from which the .CHM output files are picked up by .Git and distributed as part of a larger delivery process.
I realise in H&M it is very easy to publish exactly the same contents to Webhelp, but we don't like that this results in very much larger quantities of stand-alone files in the distribution process. Also we would need to put in time and energy to improve the Webhelp Keyword Index. The default .CHM keyword index is absolutely great, the Webhelp counterpart does not work nearly as well.
I'm in 2 minds about exploring EWriter, it seems like a huge move to solve a tiny problem. That tiny problem is achor links; we don't use them very frequently. All the other .CHM features (still) seem to work fine the way we have set it up now.
Your answer is no doubt realistic, but was unexpected. I'm sure that you're correct that our choice for Microsoft HTML Help as the principal Help format no longer seems a viable option in the long run. But at the same time, it still serves us for 98 % today.
We do actually publish all our content to Webhelp and PDF as well (by way of alternative formats).

My current conclusion from all this is that we must simply add a work instruction that anchor links, if used at all, must become conditional: they must only be published to the Webhelp output format, and will have to remain plain text in the .CHM format.
Do you perhaps have any additional thoughts? Otherwise, let's close this thread and thanks for your time!

Rob
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Anchor links do not work in CHM when published server-si

Unread post by Tim Green »

Hi Rob,

The writing has actually been on the wall about this ever since the release Windows XP SP1. Note that you are only able to open your CHM files at all because your users are still using 32-bit Windows, because that unfixable restriction that is stopping anchor links is already in those versions of Windows as well (others may follow). As soon as they upgrade to 64-bit Windows all calls to CHM files via the network will fail. Completely and permanently.
I suppose that in your alinea "Programmers...", by "make a local copy" you mean: execute a command that calls the helpman.exe on the server and that will publish .CHM to a "C:\..." output path.
No, what is meant by that is that at runtime your program running on the client machine makes a copy of the CHM to that local machine where the program is running and then routes its help calls to the local copy of the CHM. This is a runtime solution, not a build-time solution. If you wish to continue to use CHM in the long term and are deploying in a network environment this is the only viable solution. Any other workarounds will fail completely as soon as your users start using 64-bit Windows.
All the other .CHM features (still) seem to work fine the way we have set it up now.
That's OK if you are aware of the risk moving forward: It is quite possible that Microsoft will add the same restriction to 32-bit Windows as well in an update. They may not do it, but if and when they do it will be without warning, quite possibly in a normal Patch Tuesday update.
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.
prateekch
Posts: 4
Joined: Wed Oct 30, 2019 7:44 am

Re: Anchor links do not work in CHM when published server-si

Unread post by prateekch »

Hi Rob,
You have mentioned in this post that if you use the Publish button to publish from local computer to a local .CHM file, and then run the .CHM file, the anchor jumps work correctly.
Actually in my case even this is not happening. After publishing and generating the .chm file from the Help and Manual 7th edition (trial version), I am copying this chm file to my application directory. This chm help file will be used on pressing F1 button when the application is running. But selecting any text on the application and on pressing F1 button , I am getting the same error message.
i.e. Error: Can't reach this page - Make sure the web address //ieframe.dll/dnserrordiagoff.htm# is correct.

I am using Win 64 and trial version of Help and Manual - & Professional Edition (Trial Version).
I am new to the Help and Manual and don't know much about the complexity and intricacies of the Anchor and linking.
Please let me know is this feature disabled in trial version or am I missing anything important related to Anchor linking.
Can you please help me how to sort out this issue locally.

Regards
Prateek
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Anchor links do not work in CHM when published server-si

Unread post by Tim Green »

Hi Prateek,

This is most likely an error in the way you are making the call to the CHM file from your application. If the CHM opens and displays normally when you double-click on it, that is definitely the case. See this page for tutorials on how to make calls to CHMs from most current programming languages:

https://www.helpandmanual.com/support_tutorials.html
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.
prateekch
Posts: 4
Joined: Wed Oct 30, 2019 7:44 am

Re: Anchor links do not work in CHM when published server-si

Unread post by prateekch »

Thanks Tim for the early reply.
Yes, you are right as the CHM opens and displays normally when I double-click on it.
I am making the call to the CHM file from my application as below:

void MyClass::OnHelp( )
{
// When user clicks F1 on some special text (e.g. strSomeSpecialText ) in the application, control comes here. Please note that html file is available for that special text
(strSomeSpecialText.htm) in different Help
folder. In fact Help folder is a collection of all the .htm files for which user can press F1 button for special texts)

// ... some code to retrieve the help file name (full path including file name as mentioned below)
wxString strHelpFile = "C:\MyProgDir\MyAppName\help.chm"

// ... some code to get the access of Mainframe Window Pointer (e.g. m_pMainFrame) from the current class
// Note: Mainframe Window has a pointer of wxCHMHelpController i.e. wxCHMHelpController* m_ptrChmHelpCtrl;

// Now I am trying to initialize, load and display contents of help file as below
m_pMainFrame->m_ptrChmHelpCtrl->Initialize(strHelpFile); //initializing the help file
m_pMainFrame->m_ptrChmHelpCtrl->LoadFile(strHelpFile); //Loading the help file
m_pMainFrame->m_ptrChmHelpCtrl->DisplayContents(); //Display the Contents window

if(!strSomeSpecialText.IsEmpty())
{
strHelpFile = strHelpFile + "::/" + strSomeSpecialText + ".htm"; //"C:\MyProgDir\MyAppName\help.chm::/strSomeSpecialText.htm" and strSomeSpecialText.htm exists in the Help
folder
m_pMainFrame->m_ptrChmHelpCtrl->DisplaySection(strHelpFile); //This API is not working as desired. Actually it should jump to the desired location in chm file.
}
}
I am getting the following error as informed in earlier post:
i.e. Error: Can't reach this page - Make sure the web address //ieframe.dll/dnserrordiagoff.htm# is correct.
Please suggest, is there anything wrong in this approach.

Regards
Prateek
User avatar
Tim Green
Site Admin
Posts: 23155
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Anchor links do not work in CHM when published server-si

Unread post by Tim Green »

Hi Prateek,

It's not clear from your example what language you are using, but you don't appear to be using the HTML Help API. Please refer to the tutorial instructions for the language you are using, which you can find on this page:

https://www.helpandmanual.com/support_tutorials.html

Also note that your application and the CHM file must both be on the same computer. Calls across a network connection to a CHM file will not work.
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.
prateekch
Posts: 4
Joined: Wed Oct 30, 2019 7:44 am

Re: Anchor links do not work in CHM when published server-si

Unread post by prateekch »

Hello Tim
Thanks once again for your time.
I am using C++ and wxWidgets. I am making calls through wxCHMHelpController pointer.
I have gone through the reference document you have suggested for C++ section.

Regards
Prateek
Post Reply