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

Last reviewed: June 21, 1995
Article ID: Q73801
The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, versions 2.0 and 3.0
- Microsoft Visual Basic programming system for Windows, versions 1.0
  and 2.0

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.

  1. Start Visual Basic.

  2. From the File menu, choose New Project.

  3. From the File menu, choose Make .EXE program.

  4. Choose the OK button to select Project1.EXE as the .EXE filename.

  5. Exit Visual Basic.

  6. Start Windows Notepad.

  7. From the File menu, choose Open.

  8. In the Filename text box, type C:\WINDOWS\SYSTEM.INI including the correct path for the SYSTEM.INI file on your computer.

  9. Choose the OK button.

  10. Change this line:

           SHELL=PROGMAN.EXE
    

        to this line:
    

           SHELL=C:\VB\PROJECT1.EXE
    

        Chane the path to the correct path to the file created in step 4.
    

  11. From the File menu, choose Save.

  12. Exit Notepad.

  13. From the Windows Program Manager File menu, choose Exit. You should

        return to MS-DOS.
    

  14. At the MS-DOS command prompt, start Windows.

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 reference words: 1.00 2.00 3.00 286 386
KBCategory: kbenv kbprg kbprb
KBSubcategory: EnvtRun


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: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.