Is there any way ina console c++ program to print with a printer that runs off usb
Is there any way ina console c++ program to print with a printer that runs off usb
Heck, I couldn't even print via the parallel port! (From a windows console application.)
You might have to use a WinAPI function and the windows driver.
I don't remember exactly how to do this... and I've never tried it from a console application... But you have to "get a handle to the device context" and then print to the "device context" I think there's a TextOut() function and a DrawText() function.
Once you're in the windows world, It doesn't matter if your printer is parallel, USB, network, etc.
Some printers, such as my Canon, can't even print from DOS! That is, you can't simply send ASCII to them. They require a driver.
[EDIT]
Well, I looked it up in Petzold last night, and his "bare-bones" printer example is a full page long! I'm afraid it wouldn't be much help without the text, and it might be a copyright violation to post it.
Last edited by DougDbug; 03-18-2003 at 12:16 PM.