BUG: App Paths Registry Not Fully Effective For 16-bit Apps

Last reviewed: March 10, 1998
Article ID: Q178883
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

    - Microsoft Windows 95

SYMPTOMS

When you start a 16-bit Windows application the system, the following error message may appear:

   Cannot find <DLLNAME.DLL>. Windows needs this file to run
   <APPNAME.EXE>

CAUSE

The DLL that is implicitly linked to the .exe resides in a directory registered in the App Paths registry entry, and not in the same directory as the .exe.

RESOLUTION

Place the DLLs for an application in the same directory as the .exe.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Applications use the App Paths registry entry so that an application's PATH environment variable will be added to the beginning of some application-specific directories that are set globally. This applies to both 16-bit and 32-bit applications.

The App Paths registry entry is found in the following:

   HKEY_LOCAL_MACHINE
      \SOFTWARE
      \Microsoft
      \Windows
      \CurrentVersion
      \App Paths

Each particular application that uses App Paths will have a key name that is the base name and extension of the application. For example, NotePad.exe. The application key contains two REG_SZ values. The default string is the full path to the application name. The other string is a value named "Path" with one or more directory path names separated by a semicolon, similar to the format of the PATH= statement in the AutoExec.bat file.

This entry is effective for most general uses of the PATH environment in an application. However, it will not be effective for any implicitly linked DLLs that reside in a directory listed in the App Paths registry. Implicitly linked DLLs are loaded before the task is fully created and receives the modified PATH environment variable. At that time the system uses the Kernel's environment. The DLL will not be found by the system if it does not reside in the usual places where it may find DLLs. See the comments for LoadLibrary in the Windows 3.1 SDK Function Reference for more information.

However, once the application is fully loaded, it can call LoadLibrary to load DLLs that reside in a directory listed in the App Paths registry. Any functions that use the PATH environment variable will then be able to take advantage of the modified PATH supplied by the App Paths registry.

Keywords          : BseDll BseProcThrd
Version           : WINNT:3.5,4.0;
Platform          : winnt
Issue type        : kbbug


================================================================================


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: March 10, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.