Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 08-27-2005, 12:18 AM   #1 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
Printing

How can i print using (DOS) via a printer?

Many Thanks
__________________
Many Thanks, in advance!

Salchester.
The Future Is Here - Are You Ready?
Salchester is offline   Reply With Quote
Old 08-27-2005, 06:42 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
Code:
 c:\somdir> print /D:lpt1 my_file
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 08-27-2005, 10:30 AM   #3 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
Printing

Could you explain to me what everthing does, within the code you have supplied i understand the following:

c:\somdir

Many Thanks
__________________
Many Thanks, in advance!

Salchester.
The Future Is Here - Are You Ready?
Salchester is offline   Reply With Quote
Old 08-27-2005, 12:01 PM   #4 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
print is a dos program which will print the file given to your specified output, lpt1 is your print-port 1, specified by the port given in the port settings for your printer setup.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 08-27-2005, 12:14 PM   #5 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
Printing

Could you comment the code, please. What include files do i need to use etc.?

Many Thanks
__________________
Many Thanks, in advance!

Salchester.
The Future Is Here - Are You Ready?
Salchester is offline   Reply With Quote
Old 08-27-2005, 12:50 PM   #6 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
It's a buildin program in dos, the thing I pointed out, was the actual dos command you would use.
For a usage within a program, take a look at this thread, but printing from within your program is usualy handlet by asking the OS to do all the printing for you, normaly you wouldn't program your own routine.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 08-27-2005, 12:58 PM   #7 (permalink)
Salchester
Salchester
 
Salchester's Avatar
 
Join Date: Jul 2005
Location: In a house
Posts: 230
Salchester is an unknown quantity at this point
Printing

How do i print a file when i press 'P' within the menu?
What coding do i need to put in the switch statment, under case 'P'?

Many Thanks

Code:
#include <iostream.h>
#include <iomanip.h>
#include <conio.h>
#include <ctype.h>
#include <dos.h>

int main (void)
{
  char choice;
  do
  {
    cout << "P = Print File";
    cout << "Q = Quit";
    cout << "Choice: ";
    cin >> choice;
    choice = toupper (choice);
    switch (choice)
    {
      case 'P':
               break;
      case 'Q':
               break;
      default: gotoxy(46,17);
               cout << "INCORRECT";
               delay(2000);
    }
  } while (choice != 'Q');
}
__________________
Many Thanks, in advance!

Salchester.
The Future Is Here - Are You Ready?
Salchester is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Platform Independent Printing Solutions for C++ laalitseth Standard C, C++ 3 04-15-2005 01:14 AM
Printing Embedded Icons freesoft_2000 Java 0 12-29-2004 10:25 PM
Printing freesoft_2000 Java 0 11-27-2004 12:19 PM
Problem printing, please help me laurence10 Java 0 03-11-2003 05:26 PM


All times are GMT -8. The time now is 11:37 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting