FIX: DB Control Sample Release Build Won't Register

Last reviewed: September 18, 1997
Article ID: Q132203
1.20 WINDOWS kbole kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft OLE Control Developer's Kit (CDK) version 1.2

SYMPTOMS

The control is not registered and the following message is displayed:

   LoadLibrary("<PATH>...\MSVC\CDK16\SAMPLES\DB\DB.DLL")failed.

This happens when all the following conditions are true:
  • You build the DB sample or your own OLE Control with database support included, in release mode.
  • You specify the correct database OLE Control import library (OCD25.LIB) on the link line.
  • To register the control, you click Register Control on the Tools menu.

CAUSE

The reason for this failure lies in the fact that the database version of the OLE Control library (OCD25.DLL) was built with a .DEF file that contains the following LIBRARY statement:

    LIBRARY OCD250

This causes the loader to look for OCD250.DLL when loading the DB.DLL. Because the library is actually named OCD25.DLL in the system directory, the loader fails.

RESOLUTION

Rebuild the import library for OCD25.DLL to include the correct library name by following these steps:

  1. Enter the following on the MS-DOS command line to move to the MFC source directory:

    cd <path>...\msvc\mfc\src

  2. Edit the OCD25.DEF file to change the LIBRARY statement from:

          LIBRARY OCD250
    

    to:

          LIBRARY OCD25
    

  3. Correct the description statement below it if you want.

  4. Save the file.

  5. Build the import library:

    implib /nowep ocd25.lib ocd25.def

  6. Copy the import library to the CDK lib directory:

    copy ocd25.lib ..\..\cdk16\lib

  7. Rebuild the DB sample or your OLE Control containing database support in release mode. Make sure the rebuild does a link again.

Now, you can click Register Control on the Tools menu to register the sample.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Visual C++ version 1.53 for Windows.


Additional reference words: database cdk ocd25 1.20
KBCategory: kbole kbfixlist kbbuglist
KBSubcategory: CDKIss
Keywords : CDKIss kbbuglist kbfixlist kbole
Version : 1.20
Platform : WINDOWS
Solution Type : kbfix


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