SpoolFile() method (GDI.DLL)

Posted on 2003-03-31
Medium Priority
Last Modified: 2012-05-04
I've converted a 16bit application that use the SpoolFile API (GDI.DLL) to 32bit.  I upgraded the GDI function dclarations to GDI32, but saw no reference to SpoolFile.  Does the SpoolFile API still exist?  If so, where?  I checked Microsoft's obselete and deleted API listings, but SpoolFile is not mentioned.  
Question by:rpremote
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

y2ksw earned 200 total points
ID: 8238109
Yes, it exists, but is called differently.


The ScheduleJob function requests that the print spooler schedule a specified print job for printing.

BOOL ScheduleJob(

    HANDLE  hPrinter,     // specifies printer for the print job  
    DWORD  dwJobID      // print job identifier


Handle that specifies a printer for the print job. This must be a local printer that is configured as a spooled printer. If hPrinter is a handle to a remote printer connection, or if the printer is configured for direct printing, the ScheduleJob function fails.
hPrinter must be the same printer handle specifed in the call to AddJob that obtained the dwJobID print job identifer.


Specifies the print job to be scheduled. You obtain this print job identifer by calling the AddJob function.

Return Value

If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE. To get extended error information, call GetLastError.


You obtain a printer handle by calling the OpenPrinter function.
You must successfully call the AddJob function before calling the ScheduleJob function. AddJob obtains the print job identifer that you pass to ScheduleJob as dwJobID. Both calls must use the same value for hPrinter.
The ScheduleJob function checks for a valid spool file. If there is an invalid spool file, or if it is empty, ScheduleJob deletes both the spool file and the corresponding print job entry in the print spooler.

See Also

AddJob, OpenPrinter


Author Comment

ID: 8242397
y2ksw -- I received notification that you posted a comment, but I did not receive it.  Please resubmit.


Author Comment

ID: 8242412
y2ksw -- I received the information you provided.  Will give it a try.

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Expert Comment

ID: 8244413
Much more complicated than the previous Spool function :-( Maybe you should opt to send raw data by opening the LPT1 device by CreateFile and write directly. This is how I solved the problem best. There are situations where CreateFile cannot be used though.

Expert Comment

ID: 8531277
Hi rpremote,
This old question (QID 20568513) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
LVL 76

Expert Comment

ID: 8966061
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Award points to y2ksw
Please leave any comments here within the next seven days.



Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question