CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Location
    Austria
    Posts
    26

    Printing a file to a network printer

    I am writing a program in visual C++ and at one point in it, I want to send a file to our network printer. I cannot use a system("file > lpt1") call because I am on a network. What is the code I have to write in order to print a file to a network printer from a C++ program?

    Thanks


  2. #2
    Guest

    Re: Printing a file to a network printer

    Hi

    I have a similar problem. I need to print a RTF file to a printer from VC++. Any responses/suggestions would be greatly appreciated.
    Please send mail to [email protected].

    Thanks
    Paul


  3. #3
    Join Date
    Sep 1999
    Location
    New Jersey (USA obviously)
    Posts
    18

    Re: Printing a file to a network printer

    I believe that you should be able to open a file to the printer via \\servername\printer (where servername is the name of the print server, and printer is the name of the printer (i.e. \\MyServer\Dumbo). Note that the double backslash is required, and therefore must be 4 backslashes, as well as two backslashes after the servername. This should work for most printers, but keep in mind that formatting isn't an option using this method. It will print in the default font of the printer.


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