Ali,
Back when I was doing C++ I was specifically doing some high performance output to HP LaserJet printers so I was doing real low level output to the port in DOS.
You should be able to make an API call to set the current printer, and then printf() output should be fed through that printer driver.
>Sorry, I think I confused you. I made a mistake about "set printer to filename". I mean I don't want to print a text. I would like to print to a postscript file without user's intraction within an ActiveX control.