Microsoft KB Archive/107518

From BetaArchive Wiki

FIX: ON SHUTDOWN Does Not Work When a READ Is Active

ID: Q107518

2.50a WINDOWS kbprg kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft FoxPro for Windows, version 2.5a

SYMPTOMS

If you close FoxPro for Windows through the Windows Task List, the ON SHUTDOWN command doesn't execute, and control doesn't return to FoxPro for Windows. Instead, FoxPro for Windows flashes for a split second and then FoxPro disappears from the Task List. Then, when you attempt to quit Windows, the Windows message box (called by the ON SHUTDOWN command) appears and Windows hangs.

STATUS

Microsoft has confirmed this to be a problem in FoxPro 2.5a for Windows. This problem was corrected in FoxPro 2.5b for Windows.

MORE INFORMATION

Steps to Reproduce Problem

1. Create a program that contains the following code and call it

   FLLTEST.PRG:

      #DEFINE MB_ICONHAND 16
      #DEFINE MB_OK 0

      SET LIBRARY TO foxtools.fll
      MsgBox=RegFn("MessageBox","ICCI","I")
      result=CallFn(MsgBox,0,"You can not close FoxPro this way", ;
         "Close FoxPro Correctly",MB_ICONHAND+MB_OK)
      WAIT WINDOW "Please Hit Any Key to Continue"
      RELEASE LIBRARY foxtools.fll
      ON SHUTDOWN

2. Create a simple screen using the following code and save the screen as

   TEST.SPR:

      CLEAR
      @1,1 SAY "Input x" GET x DEFAULT SPACE(10)
      READ CYCLE

3. In the Command window, type:

      ON SHUTDOWN DO flltest.prg

4. In the Command window, type:

      DO test.spr

5. When the screen is running, minimize FoxPro for Windows. 6. Click any where outside Program Manager or press CTRL+ESC.

7. In the Task List window, select Microsoft FoxPro, and choose End Task.

   FoxPro will come up for a split second and then close down. It will no
   longer appear in the Task List.

8. In Windows Program Manager, choose Exit from the File menu. The Windows

   message box (called by the ON SHUTDOWN command) will appear, and then
   Windows will hang.

If the .SPR file is not running, and steps 3, 5, 6, 7, and 8 are executed, everything works properly. Additional reference words: FoxWin 2.50a buglist2.50a fixlist2.50b KBCategory: kbprg kbfixlist kbbuglist KBSubcategory: FxprgFoxtools

Keywords          : FxprgFoxtools kbbuglist kbfixlist
Version           : 2.50a
Platform          : WINDOWS
Solution Type     : kbfix

Last Reviewed: October 16, 1997
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.