Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Spooling Problem
Message
De
26/07/2001 03:44:50
 
 
À
26/07/2001 03:05:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00535548
Message ID:
00535554
Vues:
15
>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
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform