P-Code Applications Must Have MPC Used on Them

Last reviewed: July 17, 1997
Article ID: Q85225
7.00 | 1.00 1.50 MS-DOS | WINDOWS kbtool

The information in this article applies to:

  • Microsoft C/C++ for MS-DOS, version 7.0
  • Microsoft Visual C++ for Windows, version 1.0 and 1.5

SUMMARY

The /Oq switch tells the compiler to generate packed code (p-code). After the p-code program is linked, the Make P-Code utility (MPC) must be used to make the program runnable. If MPC is not used on the p-code program, depending on the program type and the host environment, different error messages will be displayed when the program is executed.

NOTE: In Microsoft C/C++ Compiler version 8.0, the linker automatically detects when you are creating a p-code application and automatically runs MPC.EXE. This means that there is no need to use the /PCODE linker switch or to separately run MPC.EXE.

MORE INFORMATION

Attempting to run an MS-DOS p-code executable that hasn't had MPC used on it may cause MS-DOS to display the following message:

   This program cannot be run in DOS mode.

A Windows-based application that has been compiled with the /Oq option but that hasn't had MPC used on it generates an unrecoverable application error (UAE) under Windows 3.0 and an application error under Windows 3.1.

Attempting to load a Windows dynamic-link library (DLL) that has been compiled into p-code but that has not had MPC run on it, can cause various problems ranging from UAEs to system hangs.

To make sure that a p-code executable or DLL is runnable, do one of the following:

  • Compile and link in one step.

    If the /Oq option is specified without the /c option, the CL driver will automatically invoke MPC after the link has been completed.

    -or-

  • Link with the /PCODE option.

    If the compile and link are done as separate steps, the /PCODE option can be used to tell the linker to invoke MPC after the link has completed.

    -or-

  • Run MPC manually.

    MPC can be used directly on the executable or DLL that was created by the linker.

For more information on p-code and controlling the p-code build process, refer to the online help on MPC and to Chapter 3 of the "Microsoft C/C++ Programming Techniques" manual supplied with Microsoft C/C++ version 7.0.

NOTE: If a Windows p-code application that has not had MPC used on it is run under MS-DOS, the following standard message will be displayed:

   This program requires Microsoft Windows.


Additional reference words: kbinf 7.00 1.00 1.50 pcode
KBCategory: kbtool
KBSubcategory: TlsMisc
Keywords : kb16bitonly


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