Microsoft KB Archive/157317

= PRB: "Invalid Library File" Loading .fll Created with VC++ 4.2 =

Article ID: 157317

Article Last Modified on 10/15/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition

-



This article was previously published under Q157317



SYMPTOMS
An .fll or .dll file has been built with Microsoft Visual C++, version 4.2. The .fll loads correctly on the development computer, but loading it on another computer with Visual FoxPro or in a distributed .exe file causes the following error message:

Invalid Library File



CAUSE
Beginning with Visual C++ 4.2, if an .fll or .dll file is compiled with the Multithreaded dynamic-link library (DLL) (/MD) option, the Msvcrt.dll C run- time library is needed for it to function properly. The Multithreaded DLL compiler option is needed when building an .fll file using the FoxPro Library Construction Kit.



RESOLUTION
Obtain the Msvcrt.dll that is installed with Visual C++ 4.2 and place it in the System (Windows 95) or System32 (Windows NT) subdirectory of the Windows directory.



STATUS
This behavior is by design.



MORE INFORMATION
The Msvcrt.dll is installed with Visual C++ 4.2 and is also shipped with Windows NT 4.0 and the Windows 95 OEM Service Release 2 (OSR 2). It is not included with Visual FoxPro 3.0 or 5.0, Windows NT 3.x, or Windows 95 (including Service Pack 1).

Developers shipping .fll files created with Visual C++ 4.2 with their Visual FoxPro applications need to include the Msvcrt.dll file in the source directory with their .exe file when running the Visual FoxPro Setup Wizard. Then in step 6 of the Setup Wizard, specify that the Msvcrt.dll should be installed in the WinSysDir.

Visual FoxPro includes other versions of the Visual C++ run-time libraries with the Distribution Source files. They are Msvcrt20.dll, Msvcrt40.dll, and Msvcrt10.dll (Visual FoxPro 3.0). The Setup Wizard automatically includes these on the setup disks that it creates.

Note that these C runtime libraries, especially Msvcrt.dll, are needed even if Microsoft Foundation Classes (MFC) are not used in the .fll or. dll file.

