Microsoft KB Archive/102929

INF: Menu Flashes on Screen, Then Returns to MS-DOS Prompt PSS ID Number: Q102929 Article last modified on 08-25-1994

2.50 | 2.00 2.50

WINDOWS | MS-DOS

= SYMPTOMS =

When a stand-alone executable file is created with the .MPR file as the main program and is then run, it immediately returns to the MS-DOS prompt after briefly flashing the menu. This behavior indicates that the menu code has been run but has not been kept in an event loop. (This problem is most noticeable in FoxPro for MS-DOS.)

= CAUSE =

When a menu is generated, running the .MPR file does not put you in an event loop or a wait state.

= RESOLUTION =

To be in an event-driven loop, use a READ command with a VALID clause that calls an event handler.

NOTE: For examples, refer to FOXPROW.PJX or FOXPRO2.PJX. The IDLEREAD.PRG program in FAMILY.PJX uses a READ VALID command to keep the family application in an event-driven loop.

= REFERENCES =

FoxPro for Windows Distribution Kit “User’s Guide,” version 2.5, “Menu Programs and Foundation READs”

Additional reference words: 2.00 2.50 foundation read drop through

=
================================================================

Copyright Microsoft Corporation 1994.