Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

9 Generating Microsoft HTML Help > 9.6 Creating links and hypertext jumps in HTML Help > 9.6.3 Linking to external files from compiled HTML Help


9.6.3 Linking to external files from compiled HTML Help

Compiled HTML Help allows calls to a non-CHM file only if the path to that file is absolute. If your Help system is always installed to the same drive and path, you can hardcode the path in the link, but that is not usually the case. Instead, you can use JavaScript to determine the location of the calling CHM file at run time and prefix that path (possibly modified with additional elements) to the target file name in the link. In effect, this method provides a relative path. See the following MSDN article for details:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/vsconocxscriptslinkchm.asp

The MSDN article says the external file must be in the same directory as the calling CHM file, but that is not true. You just have to know where the external file is relative to the calling CHM file, and use the external file name with that relative path; the JavaScript adds the first part of the path. You can use a Mif2Go macro to provide the JavaScript; see §28 Working with macros.

Linking to Web sites

For external links on the Web, you can use a hypertext message URL marker with the full Web link. However, you might encounter security issues in Internet Explorer, so test thoroughly on machines with the latest security patches. You might have to tweak Windows Registry settings, which you cannot do from within HTML Help. For example, on Windows 2000:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\HHRestrictions]

"MaxAllowedZone"=dword:00000004

"EnableFrameNavigationInSafeMode"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions]

"MaxAllowedZone"=dword:00000004



9 Generating Microsoft HTML Help > 9.6 Creating links and hypertext jumps in HTML Help > 9.6.3 Linking to external files from compiled HTML Help