FIX: UAE/GPF Occurs If EXE Uses Variable Length String in Type

ID: Q93256


The information in this article applies to:
  • Microsoft Visual Basic programming system for Windows, version 2.0


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 :
Version :
Platform :
Issue type :


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