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

ID Number: Q73801

1.00

WINDOWS

Summary:

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 3.0 shell results in a Windows 3.0

Unrecoverable Application Error (UAE). This is a design limitation

under Windows 3.0. It is not a limitation under Windows 3.1, except

when you run the .EXE application in standard mode on a 80286

computer, where a general protection (GP) fault will occur at the same

point a UAE occurs under Windows 3.0. Basically, you can only use

a Visual Basic .EXE program as a Windows shell on an 80386 computer or

better. This information only applies to Visual Basic .EXE programs.

This information applies to Microsoft Visual Basic programming system

version 1.0 for Windows.

More Information:

A user-defined shell application can be specified in the Windows

system initialization (SYSTEM.INI) file. The default shell is

PROGMAN.EXE, or the Program Manager. If a Visual Basic program is

specified as the customized Windows 3.0 shell, a Windows 3.0 UAE will

occur on an attempt to run Windows 3.0 from the MS-DOS command line.

This problem does not occur under Windows 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 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

from 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" (without

the quotation marks) or the path and filename of the SYSTEM.INI

file on your system.

9. Choose the OK button.

10. Change the line the reads "shell=progman.exe" to

"shell=c:\vb\project1.exe", or the appropriate path to the file

created in step 4 above.

11. From the File menu, choose Save.

12. Exit Notepad.

13. From the Windows Program Manager File menu, choose Exit (you

should exit back to MS-DOS).

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

When you attempt to run Windows 3.0, a UAE will occur. You will need to

reboot your computer and modify the SYSTEM.INI with a text editor from

MS-DOS such that the line "shell=c:\vb\project1.exe" appearing in the

SYSTEM.INI file is changed to "shell=progman.exe".

The above steps work without error under Windows version 3.1.

Additional reference words: 1.00 3.00 286 386