Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing to a Jurassic Printer
Message
De
20/04/1999 18:36:11
 
 
À
20/04/1999 17:01:13
George Simon
GS Data Technologies, LLC
Cincinnati, Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00210300
Message ID:
00210332
Vues:
21
>Hi Everyone,
>
>Here's the problem:
>
>I need to print to an old daisy wheel printer (NEC spinwriter) on a special form (8.5" X 7.0 tractor feed). The printer manufacturer does not have a printer driver available for this printer. They suggested using the Generic Text driver that comes with Windows 95. I set up a custom form for the Generic Text printer but when I send the report to the printer it ignores the length I set up and prints as if the form is 8.5" X 11".
>
>So I tried to find a way to stream the data directly to the printer using the SET DEVICE TO PRINT and @ x,y SAY commands like the old DOS printouts. This works until my x coordinate reaches around 4000. VFP doesn't like commands like @ 4001,1 SAY 'Hello World'.
>
>Next, I tried sending the output to a text file using the low level file functions. Then I used the RUN command to call the DOS print command like this: RUN PRINT C:\MYFILE.TXT. This works on my workstation (I'm running NTWS 4.0) but when I try this on a W95 WS I get 'bad commad or file name.'
>
>We are using this printer to print on forms that have membership cards stuck on them. A dot-matrix printer will not print on these cards.
>
>Does anyone have any ideas?
>

I'd try using the VFP native COPY FILE command, or RUN COMMAND /C COPY /B C:\MYFILE.TXT PRN; my preference is to use the Win32 API CopyFile() call, which works on both platforms unambiguously, and doesn't seem to be as picky as the VFP COPY FILE in some cases:
DECLARE INTEGER CopyFile IN WIN32API ;
   STRING @ cSourceFile, ;
   STRING @ cDest, ;
   INTEGER bFailIfExits

IF CopyFile(cSourceFile,'PRN',0) = 1
   *  It worked
ELSE
   *  It didn't
ENDIF
Don't try using CopyFileEx(), since it needs a callback function, which isn't doable in just native VFP code AFAIK.

>TIA,
>
>George
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform