Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to print ascii file ???
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00041223
Message ID:
00055688
Views:
41
>>>>>>where PRINTFIL.BAT contains:
>>>>>>
>>>>>>@echo off
>>>>>>copy /b %1 lpt1
>>>>>>erase %1
>>>>>>exit
>>>>>>
>>>>>>This copies the file, in binary mode (bypassing any Chr(26)s that it
>>>>>>sees) to the LPT1 port. You can substitute any valid port for this.
>>>>>
>>>>>Does this work with com ports also? I need to send control code out
>>>>>the
>>>>>com ports.
>>>>
>>>>I haven't tried it with serial ports, but I can't see why it wouldn't
>>>>work. I've copied other things to plotters (which always seem to be
>>>>attached serially), and they've worked without a hitch.
>>>>
>>>>>Also, is there a way to run the dos in the background
>>>>>without
>>>>>the big black ugly screen showing up? I tried setting the props in
>>>>>the
>>>>>foxrun.pif to a minimized window, but no luck!
>>>>
>>>>I've also found no way to completely remove this from the screen.
>>>>However, by using WinExec() instead of !, the time is minimized as much
>>>>as possible.
>>>>
>>>>/Paul
>>>
>>>There is a way.
>>>Through Foxpro run the batch file normally. When execution finishes, click on the close button, properties and click the checkbox, Close on exit.
>>>Then through code use the following command:
>>>Run /N2
>>>
>>>N2 runs the file Minimized. After execution, it closes and you do not see anything.
>>>
>>>Abdul Ahad
>>
>>Thanks Abdul & Paul, very good info!
>>
>>Now I have some good info, thanks again to the wonderful UT! I was cruising around in the Files section and found the "WIN32API and others APIs" category. In there I found a little library written by Jeremy Pointer called "RawPrint". I tried this with my printer (to which I MUST send control codes) and it worked! In fact I sent about 1 meg of control codes to the thing without a hitch, and without any annoying dos window (it's a .fll library). In this test I loaded all printers into an array using APRINTERS, searched for the first one attached to LPT1, and used it as the printer for the function parameter (even though it was not the printer I wanted to print to it was hooked to LPT1 so it still worked, ie no Windows control codes sent to the printer just mine!). Anyway read his readme file, it easy to use, and see if this works for you. I haven't tried it on com ports yet but I will! I used the VFP5.0a version of the library in my test.
>>
>
>I have read very good suggestions from you, but there is also any easier way which need no programming!. You can send your printing to a Generic Printer Driver. It comes with windows installation disks and you won't find any trouble installing it.
>
>Happy ascii printing!
>:)
>
>Shahbaz Ahmer
>shahbaz@cyber.net.pk

Yes, I tried this once before. Unfortunately for my application I could not get this to work. I was sending some escape codes etc which were needed by my printer, and they just wouldn't go. The printer I am operating needs just the raw codes without any interference from windows. I also used the above mentioned function (RAWPRINT) to print to a printer pointing to a com port with success.
cuo
tc
Previous
Reply
Map
View

Click here to load this message in the networking platform