CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 1999
    Posts
    6

    URGENT : Direct printing...?! How ?

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

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

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


  2. #2
    Guest

    Re: URGENT : Direct printing...?! How ?

    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


  3. #3
    Join Date
    Apr 1999
    Posts
    6

    Re: URGENT : Direct printing...?! How ?

    Thanx Thomas... ~)

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

    But thanx a lot ! Bye Torsten.


  4. #4
    Join Date
    Apr 1999
    Posts
    2

    Re: URGENT : Direct printing...?! How ?

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured