Microsoft KB Archive/218457

= BUG: Custom expression builder crashes query and View Designers =

Article ID: 218457

Article Last Modified on 2/11/2005

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q218457



SYMPTOMS
If a custom expression builder is defined with the system variable _getexpr, the Query/View Designer crashes with the following error:

Fatal error: Exception code=C0000005



RESOLUTION
Use GETEXPR in the Command window to obtain the expression. Run the following code from the Command window, and then press CTRL-V to paste the text into the Functions and expressions text box of the Designer:

GETEXPR TO x _cliptext = x



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
 Create a new form. Add a text box and a command button to the form.  Enter the following code in the command button's Click event:

gcExpr = Thisform.Text1.Text Thisform.Release

 Set the following form properties:

AlwaysOnTop True (.T.)

Desktop True (.T.)

WindowType 1 – Modal

 Save the form with the file name "MyGetExpr".  Create a new program file and enter the following code: PARAMETERS cExpressionType, cErrorMessageText, cDefaultExpression, cCaptionText

PUBLIC gcExpr gcExpr = "" Do Form MyGetExpr return gcExpr

 Save the program file with the file name "MyGetExpr.prg".</li>  In the Command window, enter the following code: _getexpr = "MyGetExpr" CREATE QUERY

</li> When the Open dialog box displays, press the ESC key.</li> Click the ellipsis next to the Functions and expressions field.</li></ol>

RESULTS: Visual FoxPro displays the error message listed in the SYMPTOMS section.

<div class="references_section">