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

ID: Q73801


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for Windows, versions 2.0, 3.0
  • Microsoft Visual Basic programming system for Windows, versions 1.0, 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 query words: 2.00 3.00 286 386

Keywords :
Version : WINDOWS:1.0,2.0,3.0
Platform : WINDOWS
Issue type :


Last Reviewed: January 25, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.