BUG: SpoolFile() Fails in Windows 95 (139011)



The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) 3.1, when used with:
    • Microsoft Windows 95

This article was previously published under Q139011

SYMPTOMS

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

RESOLUTION

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

SpoolFile() is documented as:
   HANDLE SpoolFile(lpszPrinter, lpszPort, lpszJob, lpszFile);
				
The SpoolFile() needs to be documented as follows to work:
   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:

111010 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:

138594 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.

Modification Type:MinorLast Reviewed:3/21/2005
Keywords:kbbug kbprint KB139011