Microsoft KB Archive/93256

From BetaArchive Wiki

Article ID: 93256

Article Last Modified on 1/8/2003



APPLIES TO

  • Microsoft Visual Basic 2.0 Standard Edition



This article was previously published under Q93256

SYMPTOMS

An Unrecoverable Application Error (UAE) or general protection (GP fault can occur in the resulting executable program under the following conditions:

  • Your program assigns text to a variable length string
  • The variable length string is an element of a user defined type
  • You ran the program in the Visual Basic environment immediately before you made the executable version of the program.

The UAE or GP fault occurs when the EXE is run after the VB.EXE environment has been closed. If the project used to generate the EXE is still loaded in the VB.EXE environment, the EXE will run without incident.

WORKAROUND

Load the project and compile it (make the EXE file) without executing the project first. This will create an EXE which will operate without causing the GP fault or UAE.

STATUS

Microsoft has confirmed this to be a bug in Microsoft Visual Basic programming system for Windows, version 2.0. This problem was corrected in Microsoft Visual Basic version 3.0 for Windows.

MORE INFORMATION

Steps to Reproduce Problem

  1. Start VB.EXE.
  2. Add Module1.BAS to the project by selecting New Module... from the File menu.
  3. Add the following code in Module1.BAS:

       Type VBSAMPLE
          X as String
       End Type
       Dim Y as VBSAMPLE
    
       Sub main ()
          Y.X = "hello"
       End Sub
                            
  4. From the Options menu, choose Project... Double-click the text 'Form1.' A dropdown box should display the options 'Sub Main' and 'Form1.' Select 'Sub Main.' Then choose the OK button.
  5. Press the F5 key to run the example. Then from the File menu, choose Make EXE... Name the executable T1.EXE.
  6. Close VB.EXE. (You do not need to save the project, unless you want to use it for future purposes.)
  7. From the File Manager, try to run the T1.EXE program. This results in a UAE or GP fault and the loss of the mouse cursor.



Additional query words: buglist2.00 fixlist3.00 2.00 3.00

Keywords: kbbug kbfix KB93256