Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Downloads
Search: 

Direct writing to spooler without GDI response
Ed Rauh
This class will write streams directly to the Windows spooler, completely bypassing the GDI interface. Is does not react to the VFP printer assignments, and does not force normal Windows printer behaviors like page resets, forcing a page feed at the end of a job, forcing skip to top of page between jobs. It also provides for direct, uninterpreted spooling of output files that either spools a copy of the file to print, or uses MoveFile() to directly spool the named file, which will then be deleted on successful printing of the job.
Created on
22 years ago
Downloads
2246
File type
Rating
5.00/5.00
General information
Rating:
5.00/5.00 (8 rates) Rate this item
Description
You may have several instances of the class open at once, creating multiple simultaneous spool jobs either to the same device or to different devices. NB - this does not use or work with any of the native VFP printer output commands, so if you think you can use this through report writer or work it against @...SAY or ?/?? statements, you'll be wrong. There is a moderately simple example of using the class in the comments at the beginning of the file. This class is designed to perform direct output or uninterpreted spooling of files for output through the Windows printer interface - it can work with Windows Printer names, ports including CAPTUREd and NET USEd port names, and print queue names. The output is truly raw - no normal Windows printer behavior like forcing to top of a fresh page on starting to print the output, forcing a page feed at end of job (you can always add that by adding form feeds to the stream.) This relies on the services of WINSPOOL.DRV, supported by all Windows versions through XP Professional RC2, and uses CLSHeap to provide memory management functions and static memory block allocations. It is released as freeware; use in a commercial product requires acknowledgement and attribution of the source to the author, who does not waive his copyright of the class code. Documentation, such as it is, is provided through the commenting of the code provided. Please read the comments carefully, as they describe the class interface, what the author will do as far as support, and the exceedingly small chance of having it changed to fit your idea of how it should work being done gratis because of whining, grovelling or complaining that it doesn't work the way you think it should. Bribes offered in cash, preferably in the form of large amounts of US currency (small denomination bank notes preferred), improve the chances that requests for change will be undertaken < g >. The source is provided in full, uses only native VFP code and Windows Platform SDK API calls, so modification of the class behavior is limited only by your ability to write any changes you want.
Created by

Comments
Simple to use. Great implementation example. Worked like a charm. I loved it. Thank you, Ed. Debra Froonjian, February 14, 2005

I was using copyfile api before that and sometimes I had problems with network printers. But with that class my printing jobs become excellent. It is very very helpful for me. Thank you Ed, :)))))) Metin Emre, August 3, 2005

Acrescetei o seguinte metodo à esta classe, com isto posso imprimir meus relatorios para um arquivo e controlar a formatação de pagina pela minha aplicação. *-- Gera um relatorio para arquivo PROCEDURE ReportToPrint LPARAMETERS tcSource, tcParam LOCAL lIntState, lOK, lcReportFile, lnFile lOK = .T. lcReportFile = SYS(2023)+"\"+SYS(2015)+".Txt" WITH This tcParam = STRTRAN(tcParam,"TO PRINTER","") REPORT FORM (tcSource) TO FILE (lcReportFile) &tcParam IF FILE(lcReportFile) .DocWrite(FILETOSTR(lcReportFile)) DELETE FILE (lcReportFile) ELSE lOk = .F. ENDIF ENDWITH RETURN lOK ENDPROC Robson Ribeiro, January 9, 2006

JUST GREAT. Very easy to use. Thanks to Robson as well for the FILETOSTR hint. Yashodhan Abhyankar, April 14, 2006

Add a comment
More downloads created from this member
Ed Rauh
Class to report the supported video display modes for the primary display and alter the video display mode of the Windows system dynamically. Intended for use in the development environment; use in the runtime environment is not recommended, especially since it may alter the desktop in a way that t...
Created on
22 years ago
Downloads
1528
File type
Ed Rauh
This is the initial release of a class that implements the Event object used for cross-process or cross-thread synchronization by waiting until the object is signalled. This includes CLSEVENT.PRG, the class implementation, and a short demonstration of how it can be used to implement single-instance...
Created on
23 years ago
Downloads
1315
File type
Rating
5.00/5.00
Ed Rauh
This class is used to implement the NETRESOURCE structure used by a number of WNet family calls; it both creates and parses them. The new version contains demonstration implementations of WNetAddConnection3(), and a Share enumeration of everything you can find on your net (warning - on large netwo...
Created on
25 years ago
Downloads
1827
File type
Rating
5.00/5.00
Ed Rauh
A way to allocate memory for structures needed by many API calls. CLSHEAP.PRG is a procedure library that implements a non-visual class that manages a memory heap. It can create and release static memory blocks, and provides mechanisms to transfer information between heap allocations and VFP memory ...
Created on
25 years ago
Downloads
3716
File type
Rating
5.00/5.00
Ed Rauh
This contains PROCESS.VCX - a visual class library for the API_APPRUN class described in the Launch App and wait w/o RUN or DOS box FAQ#7774. The class gives the ability to run DOS and WinApps from inside VFP using the CreateProcess() API call, and allows you to wait on termination or return immedia...
Created on
25 years ago
Downloads
4757
File type
Freeware
Rating
5.00/5.00