PRB: Known16dll Key Entry Changes Normal DLL Search Path

Last reviewed: May 22, 1996
Article ID: Q149430
The information in this article applies to:
  • Professional, and Enterprise Editions of Microsoft Visual Basic, 16-bit only, for Windows, version 4.0
  • Windows 95

SYMPTOMS

A Visual Basic program may not run under Windows 95 because a 16-bit DLL that has been listed in the registry as a Known16dll has been moved from the Windows\System directory.

CAUSE

The Registry has a Known16dll key entry for a DLL that has previously been loaded. If there is an entry in this key for a specific DLL then Windows will look for the DLL file in the Windows\System directory first and then follow the normal DLL search path. If this DLL has been moved to another location, the key entry will still be in the registry. This could cause the wrong version of a DLL to be used.

RESOLUTION

Use RegEdit to find and delete the Known16dll entry for this DLL. Windows 95 will now search for the DLL in the normal way. Once Windows 95 finds loads the DLL, a new Known16dll key entry is made in the registry.

MORE INFORMATION

The registry key Known16dlls is located in the following section of the registry:

   \\HKEY_LOCAL_MACHINE
        System
           CurrentControlSet
              Control
                 SessionManager

If there is an entry in the Known16dll key for a DLL that a Visual Basic program requires , Windows 95 will first look in the Windows\System directory, AND then follow the normal search path below.

Under Win16

  1. The current directory.

  2. The Windows directory.

  3. The Windows system directory.

  4. The directory containing the executable file for the current task.

  5. The directories listed in the PATH environment variable.

  6. The list of directories mapped in a network

If the DLL is moved from the Windows\System directory to a new location, the Known16dll key is not deleted; because of this, Windows will continue to look for the DLL in the Windows\System directory first.


Additional reference words: 4.00 vb4win vb4all
KBCategory: kbprb
KBSubcategory: EnvtRun




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