Re: Output a string to the default printer
- From: "Simon" <spambucket@xxxxxxxxxxxx>
- Date: Mon, 12 Sep 2005 22:51:35 +0100
> >We need to print a line of text every time a certain event occurs, (we
> >have
>>a
>>dot matrix printer).
>>
>>Currently and I can print using the raw "LPT1:" command, but this is a bit
>>old
>>fashioned really.
>>
>>So is there a 'easy' way to pass data to the currently selected printer?
>>I know how to get the PrintDlg(...), but how do I pass a line of text to
>>it?
>
> Simon,
>
> Printing to the printer via GDI doesn't (as far as I've ever been able
> to ascertain) cater for printing lines - only pages.
>
> Here's an old example I've posted many times in the past to illustrate
> how to print lines to a printer that can accept ascii text. It's
> probably longer than your method of writing to LPT: though!
>
<snip code>
It is a little longer but at least it accepts any printer rather than just
LPT1, (in fact we were doing LPT1 and 2 only).
As long as I can pass it to shared printer then I don't really care about
the length of the code.
The problem we have is if the printer is on machine X then and we share the
printer then we need to be able to print from machine Y.
I cannot test your code today, but I will give it a go tomorrow.
I need to list all the printers available as well as the devices so that I
can pass them to your function.
I am assuming that it does not need to be LPT1/2 I can use what ever devices
is been shared?
Would you have some code to list printers and their devices?
Many thanks
Simon
.
- Follow-Ups:
- Re: Output a string to the default printer
- From: David Lowndes
- Re: Output a string to the default printer
- References:
- Output a string to the default printer
- From: Simon
- Re: Output a string to the default printer
- From: David Lowndes
- Output a string to the default printer
- Prev by Date: Re: calling dll from c like app
- Next by Date: which CDC
- Previous by thread: Re: Output a string to the default printer
- Next by thread: Re: Output a string to the default printer
- Index(es):
Relevant Pages
|
|