BUG: Setting the Caption of a Tab Control Results in GP Fault

Last reviewed: November 17, 1995
Article ID: Q138525
The information in this article applies to:
  • Professional and Enterprise Editions of Microsoft Visual Basic, 16-bit only, for Windows, version 4.0

SYMPTOMS

Setting the caption of the Tab control to the contents of a text box may generate a general protection (GP) fault if the text box is empty. The GP fault occurs in module User.exe and is usually at the address 000B:009B.

WORKAROUND

The GP fault does not occur if the caption of the control is set directly to an empty string. For example, modify the Change event code for the Text1 control in step 5 of the "Steps to Reproduce Problem" section of this article to this:

   If Text1.Text = "" Then
      Form1.SSTab1.Caption = ""
   Else
      Form1.SSTab1.Caption = Text1.Text
   End If

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

This occurs only in 16-bit Windows because User.exe was updated in Windows 95 and Windows NT. The 32-bit version of the Sheridan tab control does not exhibit this behavior.

The GP fault occurs only when the Caption property is set to the Text property of a text box or the caption of another control, and that text box or other control does not contain text. The GP fault does not occur if the caption is set to an empty string directly.

Steps to Reproduce Problem

  1. Start Visual Basic 4.0, 16-bit Edition. Form1 is created by default.

  2. Place the Sheridan tab control onto Form1.

  3. In the Load event for Form1, place the following line of code:

    Form2.Show

  4. Add a new form to the project (on the Insert menu, click Form).

  5. On Form2, place a text box. In the Change event for the text box, place the following code:

    Form1.SSTab1.Caption = Text1.Text

  6. Run the project by pressing the F5 key. Click Form2, highlight the text inside of the text box (Text1), and press the DELETE key. On Windows for Workgroups this gives a GP fault in the User.exe module.


Additional reference words: 4.00 buglist4.00 GPF vb4win vb416
KBCategory: kbprg kbbuglist
KBSubcategory: PrgCtrlsCus


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 17, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.