Hi. I have search the internet. and most of the solution I've got is similar to the code below.
Problem is, It doesn't work for me.
i've tested the exe on several PCs, it still doesn't work.
Please help me to fix this.
Thanks.
This is the error I had after I run the exe.Code:#include <iostream> #include <fstream> using namespace std ; void main() { cout<<"Start Printing..."<<endl; ofstream printer; const char EJECT = 0x0c; printer.open("LPT1"); if( !printer ) { cerr << "Error! Could not print!"; exit(1); } printer<<"Hello World!\n"<<endl; cout<<"Hello World, printed."<<endl; printer<<EJECT; printer.close(); cout<<"Done Printing."<<endl; }
--------------------------- C:\Documents and Settings\zerodevice\Desktop\printer.exe ---------------------------
C:\Documents and Settings\zerodevice\Desktop\printer.exe
This application has failed to start because the application configuration is incorrect.
Reinstalling the application may fix this problem.
--------------------------- OK ---------------------------
I am certain my printer and driver works.
Because they were able to print other documents.