MPC Must Be Used Before P-Code .EXEs Can Run

Last reviewed: July 17, 1997
Article ID: Q82286
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, versions 1.0 and 1.5

SUMMARY

Two steps are required to build a program that uses packed code (p-code):

  • The source must be compiled with /Oq
  • The resulting .EXE must be run through the Make P-Code utility (MPC)

In the MS-DOS operating system, an attempt to run a p-code executable file that has not been processed by MPC fails and the following message appears on the screen:

   This program cannot be run in DOS mode.

In the Microsoft Windows operating system, the program may generate an unrecoverable application error (UAE) or display the following message:

   ABNORMAL PROGRAM TERMINATION

MORE INFORMATION

MPC reads the executable (.EXE) file produced by LINK and generates several internal tables needed by the run-time interpreter. Without these tables, the program is not a valid executable file. Once MPC has added these tables, the executable file can be run.

MPC can be invoked in several different ways. The CL driver calls the MPC utility after calling LINK if the enable p-code optimization (/Oq) was used. If you are compiling and linking in separate steps, MPC will be invoked by the linker if the /PCODE link option is used. It is also possible to invoke MPC from the command line, passing it the name of the executable file. If you are building your application inside the Programmer's WorkBench (PWB), choose one of the following project templates: DOS P-CODE EXE or Windows P-CODE EXE.

LINK versions 5.3 and 5.31.009 supplied with Microsoft C/C++ version 7.0 does not automatically detect that an application has been compiled into p-code. As a result, if an executable is compiled and linked in two separate steps, the only way to have MPC invoked on the executable is to either use the /PCODE linker switch or to invoke MPC manually.

Beginning with LINK version 5.5 supplied with Visual C/C++ version 1.0, the linker detects that a p-code application is being built and automatically invokes MPC on the executable.


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.