PRB: Visual FoxPro Form Is Inaccessible with Foundation READID: Q162682 The information in this article applies to:
SYMPTOMSWhen a Visual FoxPro form is run within a converted FoxPro 2.x application and program execution falls back to the Foundation READ, then some or all of the controls on the form do not respond to keyboard or mouse input.
RESOLUTIONUse a READ EVENTS to set up the wait state, rather than a Foundation READ, which uses a READ VALID.
STATUSThis behavior is by design.
MORE INFORMATIONIn order to create a wait state in FoxPro 2.x, the Foundation READ was used. This allowed an application using the FoxPro run time to continue to execute while waiting for user input--selection of a menu option, for example. In Visual FoxPro, the Foundation READ is no longer necessary, but the wait state must still be established to create an application, which uses the run time. This is now done with the READ EVENTS command. If a Visual FoxPro form is instantiated, either with DO FORM or CREATEOBJECT() within an application employing a Foundation READ, the form's controls may be inaccessible. This occurs if program execution is halted at the Foundation READ (READ VALID command) when the Visual FoxPro form is instantiated.
Steps to Reproduce Behavior1. Run the following code from a program (.prg) file:
2. Click "Do Screen" on the menu. A FoxPro 2.x style READ screen is
3. Click "Do Form" on the menu. A Visual FoxPro form is instantiated and
4. Select Exit from the menu.
To demonstrate the workaround, comment out the "READ VALID lValid" line in the above example by starting the line with an asterisk, remove the asterisk from the beginning of the "* READ EVENTS" line, and rerun the program. The screen still works as before, and now the "Close me" command button on the form is also accessible.
REFERENCEFor additional information on the Foundation READ and READ EVENTS, please see the following article in the Microsoft Knowledge Base:
Additional query words:
|
Last Reviewed: November 1, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |