FIX: Visual FoxPro crashes when two instances of the preview window are active (297803)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 3.0
  • Microsoft Visual FoxPro for Windows 3.0b
  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

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 "More Information" section.
IF WEXIST("Report Designer - testreport.frx") <existing code> 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.

MORE INFORMATION

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 ("Alec")
INSERT INTO test VALUES ("Seregil")

CREATE REPORT testReport FROM test

REPORT FORM testReport PREVIEW NOWAIT
INSERT INTO test VALUES ("Nysander")
REPORT FORM testReport PREVIEW NOWAIT
				

Modification Type:MajorLast Reviewed:2/11/2005
Keywords:kbBug kbCodeSnippet kbfix kbReportWriter kbvfp700fix KB297803 kbAudDeveloper