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

ID: Q82286

7.00 | 1.00 1.50 MS-DOS | WINDOWS kbtool

The information in this article applies to:

SUMMARY

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

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

Last Reviewed: July 18, 1997