Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 345
  • Last Modified:

SpoolFile() method (GDI.DLL)

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.  
0
rpremote
Asked:
rpremote
1 Solution
 
y2kswCommented:
Yes, it exists, but is called differently.

MSDN:

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
   );    
Parameters

hPrinter

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.

dwJobID

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.

Remarks

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

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

Thanks...rpremote
0
 
rpremoteAuthor Commented:
y2ksw -- I received the information you provided.  Will give it a try.

Thanks
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
y2kswCommented:
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.
0
 
CleanupPingCommented:
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.
0
 
GrahamSkanRetiredCommented:
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.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

GrahamSkan
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now