954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Printing in C++

hi
i am trying the following code to print the message. it is working well in a system having a printer connected through com1.
But is not working in other system that using usb port.
what should i do.


ofstream outfile;
outfile.opne("PRN");
outfile<<"\nThis is test printing";
outfile<<'\x0C';

daljeet_smt
Newbie Poster
2 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

I don't think you need to change anything in the code. Or in other words, I don't think you can change your code and make it work. It should be a matter of configuration of the printer. (which I have no clue).

thekashyap
Practically a Posting Shark
811 posts since Feb 2007
Reputation Points: 254
Solved Threads: 75
 
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You