How to Specify Filenames/Paths in Viewer/WinHelp Commands

Last reviewed: June 23, 1995
Article ID: Q120251
The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) for Windows version 3.1
  • Microsoft Win32 SDK, versions 3.5, 3.51, and 4.0

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.


Additional reference words: 3.10 3.50 4.00 95
KBCategory: kbtool
KBSubcategory: TlsHlp


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 23, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.