Help and Support

Article ID: 250059 - Last Review: August 7, 2007 - Revision: 3.3

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

This article was previously published under Q250059

On This Page

Expand all | Collapse all

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  (http://support.microsoft.com/kb/194022/EN-US/ ) INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295  (http://support.microsoft.com/kb/194295/EN-US/ ) HOWTO: Tell That a Visual Studio Service Pack Is Installed
To download the latest Visual Studio service pack, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/vstudio/Aa718353.aspx (http://msdn2.microsoft.com/en-us/vstudio/Aa718353.aspx)

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

APPLIES TO
  • Microsoft Visual FoxPro 6.0 Professional Edition, when used with:
    • Microsoft Windows NT 4.0
    • the operating system: Microsoft Windows 2000
    • Microsoft Windows 98 Standard Edition
Keywords: 
kbbug kbfix kbprint kbreportwriter kbvs600sp4fix kbvs600sp5fix kbxbase KB250059

Article Translations