Printing on a Network
A version of this page is also available for
4/8/2010
Once you have the name of a printer, to print on a network use the CopyFile function or the CreateFile and WriteFile functions.
To print using CopyFile
Call CopyFile, specifying the network printer to use and which file to print.
CopyFile has the following syntax.
CopyFile (szSrcFile, szUNCPrinterShare, FALSE);
The file to print is szSrcFile. The network printer to use is szUNCPrinterShare, which can accept a UNC name returned by the WNetEnumResource function.
To print using CreateFile and Writefile
Create a file on the network printer by calling CreateFile.
Write the data or document to be printed to the newly created file by calling the WriteFile function.
Close the fileto queue the print job.
See Also
Concepts
Windows Networking API/Redirector Application Development
Managing Network Connections with WNet