Microsoft Knowledge Base Email Alertz

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.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 297803 - Last Review: February 11, 2005 - Revision: 4.1

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

This article was previously published under Q297803

On This Page

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
				

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
Keywords: 
kbbug kbcodesnippet kbfix kbreportwriter kbvfp700fix KB297803
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate