>I want to use matrix printer with ??? command. Here are the code:
>
>mPrinter = GetPrinter()
>IF EMPTY(mPrinter)
> RETURN
>ENDIF
>SET PRINTER TO NAME (mPrinter)
>???
>.....
>SET PRINTER TO NAME ALLTRIM(SET("PRINTER",2))
>
>When the Spool settings (control panel) of printer are set to "Spool print jobs ..." everything is OK, but when I set them to "Print directly to the printer" SET PRINTER TO NAME (mPrinter) gives me an error "Error accessing printer spooler". How can I by-pass the spool settings. (The printer I use is network printer connected to LPT1 w/ capture printer port) ?
>
Using VFP, you can't; VFP talks to the spooler layer in it's manipulation of the print queues. You could take several approaches to the problem, the simplest solution being to write the print output to a file and then queue it using the Windows API; there is also the option of completely bypassing VFP's print interface, and using the Windows API entirely, using OpenPrinter() to get a handle to the printer, using StartDocPrinter() and StartPagePrinter() to open a fresh print stream, and then using WritePrinter() to write data to the printer completely bypassing the GI. I've been playing with a class based on this general approach to printer manipulation with a good deal of success, relying on ClsHeap to manage some of the data structures. I'll try to finish it and post it over the next few days, but the initial release will probably be 'as-is'.
You might want to look into the file RAWPRINT in the Files section - it may do what you need done.
>TIA
>
>Boris