GP Fault After Pressing TAB in User-Defined Dialog Box

Last reviewed: August 4, 1997
Article ID: Q112778
6.00 6.00a WINDOWS kbusage kbmacro

The information in this article applies to:

  • Microsoft Word for Windows, versions 6.0, 6.0a

SYMPTOMS

When you run a WordBasic macro that displays a user dialog, a general protection (GP) fault may occur after you press TAB. The macro in the "More Information" section below in this article demonstrates this behavior.

CAUSE

This happens if the focus switches to a text control in the user dialog when you press TAB.

STATUS

Microsoft has confirmed this to be a problem in Word versions 6.0 and 6.0a for Windows. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The macro below demonstrates this behavior.

IMPORTANT: If you run this macro, a GP fault will occur on your computer and you may lose unsaved data in any open applications.

Sub MAIN
Begin Dialog UserDialog 285, 85, "No Focus on Text!", .DlgFunction
 OKButton 191, 58, 88, 21
 Text 42, 15, 216, 13, "Don't Set the Focus to Text!", .sText
End Dialog Dim dlg As UserDialog x = Dialog(dlg)
End Sub

Function DlgFunction(id$, Action, Other) Select Case Action
 Case  1
  DlgFocus$ 1
  x$ = DlgFocus$()
 Case  2
  If id$ = "OK" Then
   DlgFunction = 0
  Else
   DlgFunction = 1
  End If
 Case Else
End Select End Function

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Kbcategory: kbusage kbmacro KBSubcategory:


Additional reference words: 6.00 6.00a gpf winword word6
Version : 6.00 6.00a
Platform : WINDOWS


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: August 4, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.