PRB: _ED Functions in Toolbar Causes Fatal Error

Last reviewed: February 28, 1996
Article ID: Q145693
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b

SYMPTOMS

When you use the _ED* editor functions to achieve cut, copy, and paste functionality in an application and the editor functions are part of a toolbar, use of the commands will cause Visual FoxPro to quit abnormally.

STATUS

Microsoft is researching this behavior and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new form, and place a single text box on it.

  2. Enter some text into the Caption property of the text box.

  3. Copy and paste the code listed in the "Sample Code" section into a .prg file, and then run the program.

  4. Run the form.

  5. Highlight the text in the text box, and choose Copy from the toolbar.

  6. Delete the text from the text box, and choose the Paste from the toolbar. Visual FoxPro will quit.

Sample Code

**---------------------------------------------------------------**

** Begin code sample                                             **
**---------------------------------------------------------------** PUBLIC oEditBar

   oEditBar=CreateObject('editbar')
   oEditBar.Visible=.t.

   DEFINE CLASS editbar AS toolbar

       Caption = "Edit Controls"
       Height = 30
       Left = 0
       Top = 0
       Width = 132
       Name = "editbar"

       ADD OBJECT cmdcut AS commandbutton WITH ;
           Top = 4, ;
           Left = 6, ;
           Height = 23, ;
           Width = 24, ;
           Picture = "cut.bmp", ;
           Caption = "", ;
           Default = .F., ;
           ToolTipText = "Cut", ;
           Name = "cmdCut"

       ADD OBJECT cmdcopy AS commandbutton WITH ;
           Top = 4, ;
           Left = 29, ;
           Height = 23, ;
           Width = 24, ;
           Picture = "copy.bmp", ;
           Caption = "", ;
           Default = .F., ;
           ToolTipText = "Copy", ;
           Name = "cmdCopy"

       ADD OBJECT cmdpaste AS commandbutton WITH ;
           Top = 4, ;
           Left = 52, ;
           Height = 23, ;
           Width = 24, ;
           Picture = "paste.bmp", ;
           Caption = "", ;
           Default = .F., ;
           ToolTipText = "Paste", ;
           Name = "cmdPaste"

       ADD OBJECT separator1 AS separator WITH ;
           Top = 4, ;
           Left = 81, ;
           Height = 0, ;
           Width = 0, ;
           Name = "Separator1"

       ADD OBJECT cmdundo AS commandbutton WITH ;
           Top = 4, ;
           Left = 81, ;
           Height = 23, ;
           Width = 24, ;
           Picture = "undo.bmp", ;
           Caption = "", ;
           Default = .F., ;
           ToolTipText = "Undo", ;
           Name = "cmdUndo"

       ADD OBJECT cmdredo AS commandbutton WITH ;
           Top = 4, ;
           Left = 104, ;
           Height = 23, ;
           Width = 24, ;
           Picture = "redo.bmp", ;
           Caption = "", ;
           Default = .F., ;
           ToolTipText = "Redo", ;
           Name = "cmdRedo"

       PROCEDURE Init
           SET LIBRARY TO SYS(2004)+"FOXTOOLS.FLL"
       ENDPROC

       PROCEDURE cmdcut.Click
           =_EdCut(_WOnTop())
       ENDPROC

       PROCEDURE cmdcopy.Click
           =_EdCopy(_WOnTop())
       ENDPROC

       PROCEDURE cmdpaste.Click
           =_EdPaste(_WOnTop())
       ENDPROC

       PROCEDURE cmdundo.Click
           =_EdUndo(_WOnTop())
       ENDPROC

       PROCEDURE cmdredo.Click
           =_EdRedo(_WOnTop())
       ENDPROC

   ENDDEFINE
**---------------------------------------------------------------**
** End code sample                                               **
**---------------------------------------------------------------**


Additional reference words: 3.00 3.00b VFoxWin gpf fatal error
KBCategory: kbprg kbprb
KBSubcategory: FxprgToolbar


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: February 28, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.