Microsoft KB Archive/73801

= PRB: UAE or GP Fault with VB .EXE Acting as Windows 3.0 Shell =

Article ID: 73801

Article Last Modified on 12/12/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Standard Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 2.0 Professional Edition
 * Microsoft Visual Basic 3.0 Professional Edition
 * Microsoft Visual Basic 1.0 Standard Edition

-



This article was previously published under Q73801



SYMPTOMS
Compiled Visual Basic .EXE applications can be used as the Windows shell in Windows version 3.1 on an 80386 computer or better. However, an .EXE application created by Visual Basic cannot be used as the Windows shell in Windows version 3.0. Attempting to run an application as the Windows version 3.0 shell results in an Unrecoverable Application Error (UAE).



STATUS
This is a design limitation of Windows version 3.0. It is not a limitation in Windows version 3.1, with one exception. When you run the .EXE program in Windows version 3.1 standard mode on a 80286 computer, a General Protection (GP) fault occurs at the same point where a UAE occurs in Windows version 3.0.

Basically, you can use a Visual Basic .EXE program as a Windows shell only on an 80386 computer or better. This information applies only to Visual Basic .EXE programs.



MORE INFORMATION
A user-defined shell application can be specified in the Windows system initialization (SYSTEM.INI) file. The default shell is PROGMAN.EXE (the Program Manager). If a Visual Basic program is specified as the customized Windows 3.0 shell, a Windows 3.0 UAE occurs on any attempt to run Windows version 3.0 from the MS-DOS command line. This problem does not occur with Windows version 3.1.

A Visual Basic application cannot be run as the Windows 3.0 shell because it does not contain the special set of startup code required by a Windows 3.0 shell application. The only way to create a Windows 3.0 shell application is to use the C Compiler and the Windows Software Development Kit (SDK) to write a non-Visual Basic application.

Steps to Reproduce Problem
WARNING: The following steps require changing the Windows system initialization file (SYSTEM.INI) in a manner such that Windows version 3.0 will not run successfully unless the file is restored from MS-DOS. The file can be restored from MS-DOS by using a backup copy of the SYSTEM.INI file or by restoring the SYSTEM.INI file with a text editor in MS-DOS.

 Start Visual Basic. From the File menu, choose New Project. From the File menu, choose Make .EXE program. Choose the OK button to select Project1.EXE as the .EXE filename. Exit Visual Basic. Start Windows Notepad.</li> From the File menu, choose Open.</li> In the Filename text box, type C:\WINDOWS\SYSTEM.INI including the correct path for the SYSTEM.INI file on your computer.</li> Choose the OK button.</li>  Change this line: <pre class="fixed_text">      SHELL=PROGMAN.EXE to this line: <pre class="fixed_text">      SHELL=C:\VB\PROJECT1.EXE Chane the path to the correct path to the file created in step 4. </li> From the File menu, choose Save.</li> Exit Notepad.</li> From the Windows Program Manager File menu, choose Exit. You should return to MS-DOS.</li> At the MS-DOS command prompt, start Windows.</li></ol>

When you attempt to start Windows version 3.0, a UAE occurs. You will need to reboot (restart) your computer and modify the SYSTEM.INI file using a text editor in MS-DOS to reverse the change made in step 10.

Additional query words: 2.00 3.00 286 386

Keywords: kbprb KB73801

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.