How to Specify Filenames/Paths in Viewer/WinHelp Commands (120251)



The information in this article applies to:

  • Microsoft Platform Software Development Kit (SDK) 1.0
  • Microsoft Win32 Software Development Kit (SDK) 3.5
  • Microsoft Win32 Software Development Kit (SDK) 3.51
  • Microsoft Win32 Software Development Kit (SDK) 4.0

This article was previously published under Q120251

SUMMARY

Both WinHelp and Viewer have commands such as JumpId() that take a filename as a parameter. Depending on the circumstances under which such commands are called, the number of backslashes (\) included in the filename as part of the path may have to be doubled for the command to work correctly. For example, if JumpId() is called from a HotSpot, you need to use two backslashes to separate the subdirectory names as in this example:
   JumpId("C:\\MYAPP\\HLPFILE\\MYHLP.HLP","topicx")
				
But if JumpId() is used as the command associated with a menu item, you need to use four backslashes to separate the subdirectory names within the JumpId command, which is itself part of an InsertItem() command. For example:
   InsertItem("MNU_FILE","my_id","Jump",

      "JumpId('C:\\\\MYAPP\\\\HLPFILE\\\\MY HLP.HLP','topicx')",0)
				
To avoid having to modify the filename parameter depending on how the function is called, Microsoft recommends that you use a single forward slash (/) to separate subdirectory names within the filename. For example:
   JumpId("C:/MYAPP/HLPFILE/MYHLP.HLP","topicx")
				
A single forward slash will work regardless of how the command is called.

Modification Type:MinorLast Reviewed:7/11/2005
Keywords:KB120251