Microsoft KB Archive/93256

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

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.



Steps to Reproduce Problem
 Start VB.EXE. Add Module1.BAS to the project by selecting New Module... from the File menu.  Add the following code in Module1.BAS: Type VBSAMPLE X as String End Type Dim Y as VBSAMPLE

Sub main Y.X = &quot;hello&quot; End Sub  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. Press the F5 key to run the example. Then from the File menu, choose Make EXE... Name the executable T1.EXE. Close VB.EXE. (You do not need to save the project, unless you want to use it for future purposes.)</li> 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.</li></ol>

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

Keywords: kbbug kbfix KB93256

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.