GP Fault After Pressing TAB in User-Defined Dialog Box

ID: Q112778

6.00 6.00a WINDOWS kbusage kbmacro

The information in this article applies to:

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

Last Reviewed: August 4, 1997