Click to See Complete Forum and Search --> : URGENT : Direct printing...?! How ?


Torsten Jochem
April 2nd, 1999, 04:22 PM
Hello...!

I have a big (for me) problem :
I want to print _directly_ to a specified printer. Well, the user have several printers installed on his system and i want to print a bill on one specified printer without showing the PrintDialog.
I have already tried to realize it with the 'SelectPrinter'-Function, the DEVMODE- and DEVNAMES-Structure, but unfortunately it did not work so far...
:o(

I would be very glad if someone could give me a tip or some sample code...

...thanx in advance very much, Torsten Jochem. ~:o)

April 2nd, 1999, 05:04 PM
I can give you a hint for direct printing to the default printer
You simply have to to modify the m_bDirect - member in the pInfo struct.
Do this in your override of the OnPreparePrinting

hope that helps

thomas

Torsten Jochem
April 2nd, 1999, 05:11 PM
Thanx Thomas... ~:o)

..unfortunately, i have 2 printers on the system. A small bill-printer (thermo) and a (normal DINA4) printer for larger lists...

...the application shall print different reports (bills and lists) to the 'bill-printer' or the 'list-printer' without showing this Print-Dialog.
Unfortunately only ONE printer can be the default printer... :o(

But thanx a lot ! Bye Torsten.

Rajan K
April 4th, 1999, 04:15 AM
Hi....

* * * * * Happy Easter. * * * * *

first open the printer port (LPT1/LPT2) whichever you want using CreateFile().
then using WrieFile() function you can send data to the specified Printer.

Hope this is enough for you.

bye & good luck.

Rajan K

Regards...

Rajan K