Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Windows Default printer
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00498854
Message ID:
00499160
Vues:
35
>Hi Arne,
>
>>Can I assume that you want to read the Windows default printer settings, not reading from the printer directly - i.e. the hardware settings?
>
>Right! I do not want to read the printer hardware settings but rather the codes that windows uses to control the different printout appearance like 12 cpi, bold, condensed, etc..
>
>In fact, since I am in DOS, my needs are quite modest. I mostly need the printing codes for 10, 12, 15, 20 cpi and condensed of windows default printer. Obviously I am thinking more and more to have all the reports of this application in VFP. That would solved the problem instantly. But for now it would be very useful to be able to get the codes from windows to my DOS application.
>
>I like your idea of a routine that would get the codes into Foxpro and I will search for that.
>
>And maybe I could make it myself, If I only knew where the codes are hiden. Anyone knows?
>
>Réal
>
>>>Hi,
>>>
>>>Anyone knows if it is possible to read the printing codes (12 cpi, condensed, etc..) of the default printer with a Foxpro 2.x program running in DOS under Windows?
>>>
>>
>>Can I assume that you want to read the Windows default printer settings, not reading from the printer directly - i.e. the hardware settings? You cannot do this directly from 2.x because there is no hook to the windows API BUT, you could write a small routine (or find one?) to read the windows registry in another language and execute it using the !/RUN command. The program could return the values you want from the Windows registry which you could then read from 2.x. You probably do not want to write this in VFP - although you could - because of the large runtime module overhead. C++ or Java would be preferable. Not much but hope it helps.
>>
>>-Arne

Real,

There are many places that these codes could be "stored"; the Windows registry will contain info about which printer is the default printer but I do not believe it will actually store values for, say, putting the printer into 12pitch or condensed. This is handled by the printer driver itself. Windows simply stores which *driver* is the default. So, I believe the only thing you can do is to "ask" windows what the default driver is, and then have your FP app decide which codes to send. I vaguely remember that FP2.x has printer driver capabilities and functionality, but it's been a long time and I'm not entirely sure how it worked. Under VFP, this is pretty easy to do.

So, you want a simple windows routine that tells you what the printer driver is, and then have your app decide what codes to send. Frankly, if you can do it, you're better off migrating the code to VFP. You may also find that you run into problems printing from DOS under Windows because of Windows' DOS printer handling - I (and my users) have often received annoying and confusing Windows dialog boxes regarding which application (Windows or DOS) should have control of the printer port. This gets complicated and depends on how the printer driver is setup under Windows.

Best of luck.

-Arne
arne@synercom-edi.com "There are no absolutes but this one."
President, synercom/edi - Event Ticketing Solutions
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform