Re: Output a string to the default printer



> >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


.



Relevant Pages

  • Re: Using a novell shared printer from debian.
    ... >> I don't have any problem to use the resource of windows environment ... >> netware shared printer. ... > I think printing is still pretty much a nightmare in Linux. ...
    (Debian-User)
  • Re: long time to print
    ... > I have this one computer i am printing through a shared printer and whenever> i print from the computer,it can take up to 2 minutes before it starts> printing out. ... I have tryed to reinstall the print> drivers on both the computer i am trying to print from and the computer that> is sharing the printer.The computer that is sharing the printer is win98 and> my computer that i am trying to print from is win2k. ... I have tryed to restart> the print spooler on the 2k machine, tryed restarting both computers still> did not help? ...
    (microsoft.public.win2000.printing)
  • Re: Print Spooler Service Not Running...
    ... But it is started on the PC that the shared printer is attached to? ... Windows Technologies - Printing & Imaging ...
    (microsoft.public.windowsxp.print_fax)
  • Printing to shared printers
    ... print and printing to a shared printer, ... Darrell ... Prev by Date: ...
    (comp.graphics.apps.gnuplot)
  • Re: Problems Printing through Netgear PS110
    ... > Did you install the netgear printing software on the clients? ... >> device, the job just hangs, with a printing error after about a minute. ... >> suddenly I can print from all machines, ... >> Simon Gurner ...
    (microsoft.public.windows.server.sbs)