BUG: SpoolFile() Fails in Windows 95

Last reviewed: January 15, 1998
Article ID: Q139011
The information in this article applies to:

- Microsoft Windows Software Development Kit (SDK) for Windows 95

SYMPTOMS

SpoolFile() fails in Windows 95, or it fails to remove the spooled file.

RESOLUTION

SpoolFile() will spool the file if the first two parameters are reversed.

SpoolFile() is documented as:

   HANDLE SpoolFile(lpszPrinter, lpszPort, lpszJob, lpszFile);

But, to make it work, call it this way:

   HANDLE SpoolFile(lpszPort, lpszPrinter, lpszJob, lpszFile);

There is no way to get SpoolFile() to remove the spooled file. The file must be removed by the calling application once the file has been printed.

MORE INFORMATION

For information on an alternative to SpoolFile(), please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q111010
   TITLE     : HOWTO: Use PASSTHROUGH As An Alternative to SpoolFile()

For more information on sending printer-specific data to a printer in Win32, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q138594
   TITLE     : HOWTO: Send Raw Data to a Printer by Using the Win32 API

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional query words: 4.00 SpoolFile Raw RAW.DRV PASSTHROUGH
Keywords : GdiPrn kbprint
Platform : Win95
Issue type : kbbug


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 15, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.