PRB: Building 16-Bit OLE Control on a Dual-Boot Computer

Last reviewed: August 7, 1997
Article ID: Q131043
The information in this article applies to:
  • Microsoft OLE Control Development Kit (CDK) included with: - Microsoft Visual C++ for Windows, versions 1.51, 1.52

SYMPTOMS

Having installed the 16-bit version of the CDK on a dual-boot computer capable of running Windows NT (or Windows 95) and Windows version 3.1x, you may encounter problems attempting to build the type library for your OLE Custom Control under Windows version 3.1x. Choosing Make TypeLib from the Tools menu may briefly display an MS-DOS window with this message:

   Project can only be run in Windows.

CAUSE

When running the CDK setup program under Windows NT or Windows 95, the Make TypeLib menu command is configured to execute a batch file called BLDTYPLB.BAT. This batch file executes the MKTYPLIB.EXE utility to build the project's type library. Because Windows programs cannot be executed directly from the MS-DOS command prompt under Windows version 3.1x, the error message is displayed. Under Windows NT and Windows 95, Windows programs can be launched directly from the MS-DOS command prompt.

RESOLUTION

To readily build your 16-bit OLE Custom Control project from Windows NT (or Windows 95) and Windows version 3.1x, add an additional menu item to your tools menu by using the Tools dialog box (choose Tools from the Options menu).

For Windows version 3.x, configure a Tools menu item with these settings:

Command Line     : C:\MSVC\BIN\MKTYPLIB.EXE
Menu Text        : Make TypeLib &Win16
Arguments        : /cpp_cmd C:\MSVC\BIN\cl /W0 /I C:\MSVC\CDK16\INCLUDE
                   /nologo $Proj.odl /tlb tlb16\$Proj.tlb
Initial Directory: $ProjDir

For Windows NT and Windows 95, configure another Tools menu item with these settings:

Command Line     :  C:\MSVC\CDK16\BLDTYPLB.BAT
Menu Text        :  Make Type&Lib Win32
Arguments        :  $Proj.ODL C:\MSVC\BIN $Proj.Dir
                    C:\MSVC\CDK16\INCLUDE
Initial Directory: $ProjDir

When running Visual C++ version 1.5x under Windows version 3.1x, use the "Make TypeLib Win16" menu item to build the project's type library. When running under Windows NT or Windows 95, use the "Make TypeLib Win32" menu item.

REFERENCES

For additional information on the Tools dialog box, please see the Visual C++ Help file or User's Guide.

Keywords          : CDKIss kb16bitonly
Technology        : kbole
Version           : 1.51.152


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


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