benlinkknilneb
Programmer
I'm writing a small C++ app that I would like to connect to my printer. Everywhere I've ever looked showed the use of
but when i did this, i got nothing. No errors, no warnings, nothing printed out. The computer appeared to open LPT1 successfully, but nothing came out. I double-checked, and that IS the port my printer is on... so I'm at a loss. Can anyone show me another simple way? I don't want to go through the MFC device contexts and stuff.
Ben
Code:
#include<fstream.h>
int main()
{
ofstream printer("LPT1");
printer<<"This text should appear on the printer"<<endl;
return 0;
}
but when i did this, i got nothing. No errors, no warnings, nothing printed out. The computer appeared to open LPT1 successfully, but nothing came out. I double-checked, and that IS the port my printer is on... so I'm at a loss. Can anyone show me another simple way? I don't want to go through the MFC device contexts and stuff.
Ben