How Help Locates .DLL and .EXE Files

When executing custom DLLs and applications using the RegisterRoutine and ExecProgram macros, Windows Help loads .DLL and .EXE files only when they are needed by the Help file. To load a DLL or application, Help must be able to find it on the user’s system. When preparing to use a .DLL or .EXE file, Help looks in the following locations:

1.nHelp’s current directory

2.nThe MS-DOS current directory

3.nThe user’s Windows directory

4.nThe Windows SYSTEM directory

5.nThe directory containing WINHELP.EXE

6.nThe directories listed in the user’s PATH environment variable

7.nThe directories specified in WINHELP.INI

If Help cannot find the .DLL or .EXE file after searching in all these locations, it displays an error message.

To increase the likelihood that Help will locate the .DLL or .EXE file quickly, follow these guidelines:

nUse unique names for all .DLL and .EXE files accessed by the Help file.

nWhen installing your application on a user’s hard disk drive, your setup program should copy all custom DLLs and executable files to the directory where Help is located.

nIf your product is distributed on CD-ROM, copy the WINHELP.EXE and custom .DLL and .EXE files to the user’s hard disk drive.

nDefine a WINHELP.INI entry for each custom .DLL or .EXE file that your Help file is using so that Help knows where to locate them.

For an explanation of the WINHELP.INI file, see “Creating Links Between Help Files” in Chapter 8, “Creating Links and Hot Spots”.