Microsoft KB Archive/297803

= FIX: Visual FoxPro crashes when two instances of the preview window are active =

Article ID: 297803

Article Last Modified on 2/11/2005

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q297803



SYMPTOMS
If you attempt to preview a report for a second time while a preview window from that report is still active, Visual FoxPro (VFP) may crash.



RESOLUTION
Test for an existing window by using the WEXIST function. To do this, add the following code before the REPORT command in the code that is given in the &quot;More Information&quot; section. IF WEXIST(&quot;Report Designer - testreport.frx&quot;) ENDIF VFP detects that a window is already open for this report and does not attempt to open a second preview window for the same report.



STATUS
This problem was corrected in Microsoft Visual FoxPro version 7.0 for Windows.



Steps to Reproduce Behavior
To reproduce the behavior, run the following code: *!* Q297803 FIX: Visual FoxPro Crashes When Two Instances of REPORT FORM PREVIEW Are Active SET SAFETY OFF

CREATE CURSOR test (field1 C(10)) INSERT INTO test VALUES (&quot;Alec&quot;) INSERT INTO test VALUES (&quot;Seregil&quot;)

CREATE REPORT testReport FROM test

REPORT FORM testReport PREVIEW NOWAIT INSERT INTO test VALUES (&quot;Nysander&quot;) REPORT FORM testReport PREVIEW NOWAIT

Keywords: kbbug kbfix kbcodesnippet kbreportwriter kbvfp700fix KB297803

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.