I'm trying to get a tractor-feed, dot matrix printer to do a few things that the regular VB Printer object won't allow me to do. Specifically, I'm trying to get the printer to reverse feed the paper a little bit.
The printer's manual lists commands in hex and decimal that I can send to the printer to make it do certain things, one of which is a reverse line feed. I have been unable to figure out how to send these commands to the printer. Obviously, I can't just send the hex codes through the Printer's Print method - the printer will just print the codes. I have been fiddling around with the WritePrinter API but I'm still doubtful as to whether this is the way to go. Besides, I haven't gotten it to work yet anyway.
The first question is: how might I send these commands to my printer so that it interprets them as commands and not text to be printed?
If I should use the WritePrinter API, can I just use the hDC property of the Printer object for the first argument of the function or do I really need to use OpenPrinter to acquire the correct handle?
My attempts at using WritePrinter have loaded Error.LastDllError with a value of 6. What does this error code mean?
The printer's manual lists commands in hex and decimal that I can send to the printer to make it do certain things, one of which is a reverse line feed. I have been unable to figure out how to send these commands to the printer. Obviously, I can't just send the hex codes through the Printer's Print method - the printer will just print the codes. I have been fiddling around with the WritePrinter API but I'm still doubtful as to whether this is the way to go. Besides, I haven't gotten it to work yet anyway.
The first question is: how might I send these commands to my printer so that it interprets them as commands and not text to be printed?
If I should use the WritePrinter API, can I just use the hDC property of the Printer object for the first argument of the function or do I really need to use OpenPrinter to acquire the correct handle?
My attempts at using WritePrinter have loaded Error.LastDllError with a value of 6. What does this error code mean?