ID: Q85225
7.00 | 1.00 1.50 MS-DOS | WINDOWS kbtool
The information in this article applies to:
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.
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:
If the /Oq option is specified without the /c option, the CL driver will automatically invoke MPC after the link has been completed.
-or-
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-
MPC can be used directly on the executable or DLL that was created by the linker.
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
Last Reviewed: July 18, 1997