FIX: Accessing Printer Drivers After Issuing SYS(1037) Might Cause Error (250059)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 6.0, when used with:
    • the operating system: Microsoft Windows NT
    • the operating system: Microsoft Windows 2000
    • the operating system: Microsoft Windows 98

This article was previously published under Q250059

SYMPTOMS

In Microsoft Visual FoxPro Service Pack 3, issuing SYS(1037) followed by either GETPRINTER() under Microsoft Windows NT or Windows 2000, or by selecting Cancel from the Page Setup dialog box and then the CREATE REPORT FROM command under Windows 98 causes FoxPro to close with the following error:
Fatal Exception: Exception Code = C0000005

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in the latest service pack for Visual Studio 6.0.

For additional information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That a Visual Studio Service Pack Is Installed

To download the latest Visual Studio service pack, visit the following Microsoft Web site:

MORE INFORMATION

This problem is specific to the previously mentioned commands and operating systems and has not been reproduced on Windows 95. Nor does it happen with the original release of Visual FoxPro 6.0.

For all the methods listed below to reproduce this problem, make sure you have one or more printers set up in the Printers control panel. The printer (or printers) can be on a network, local port, or even directed to the File port. The printer driver that you use does not appear to make a difference.

Steps to Reproduce Behavior

Under Windows NT or Windows 2000 (two methods listed):
  • GETPRINTER() with SYS(1037):

    1. In the Command window, enter:
      ? SYS(1037)
      and press the ENTER key. Press either OK or Cancel to close Page Setup.

    2. Next, enter:
      ? GETPRINTER()
      and press the ENTER key.

  • GETPRINTER() with Page Setup:

    1. From the File menu, choose the Page Setup command. Click OK or Cancel to close Page Setup.
    2. In the Command window, enter:
      ? GETPRINTER()
      and press the ENTER key.
Under Windows 98:

Copy the following code to a .prg file and run it on a Windows 98 machine with Visual FoxPro 6.0 Service Pack 3:
a = SYS(1037)
CREATE TABLE dummy2 (dummy C(1))
USE IN dummy2
CREATE REPORT test FROM dummy2
ERASE DUMMY2.dbf
ERASE test.frx
ERASE test.frt 
				
Click Cancel when the Page Setup dialog box appears.

Notice that with all the methods above, FoxPro generates the following error and then closes.
Fatal Exception: Exception Code = C0000005

Modification Type:MinorLast Reviewed:12/12/2005
Keywords:kbBug kbfix kbprint kbReportWriter kbVS600sp4fix kbVS600sp5fix kbXBase KB250059 kbAudDeveloper