F
Frederick Williams
I'm trying to print to a LaserJet P1006 plugged into a USB port with
this:
#include <stdio.h>
int main(int argc, char *argv[])
{
FILE *p;
int tmp;
p = fopen("USB001", "w");
tmp = fprintf(p, "Sample\n");
if (tmp == EOF)
puts("EOF");
else
printf("Return: %d.\n", tmp);
return 0;
}
tmp == 7 which is gratifying, but nothing comes out of the printer
(which otherwise works fine). In place of "USB001", I've tried
"USB002", "prn:", "prn", "lpt:file.txt", "USB001:file.txt" and
"USB002:file.txt" with the same (lack of) effect. "USB001:", "lpt:" and
"USB002:" cause the MS Visual C debugger to complain that the string
"USB001:", "lpt:" or "USB002:" is null.
Any thoughts?
this:
#include <stdio.h>
int main(int argc, char *argv[])
{
FILE *p;
int tmp;
p = fopen("USB001", "w");
tmp = fprintf(p, "Sample\n");
if (tmp == EOF)
puts("EOF");
else
printf("Return: %d.\n", tmp);
return 0;
}
tmp == 7 which is gratifying, but nothing comes out of the printer
(which otherwise works fine). In place of "USB001", I've tried
"USB002", "prn:", "prn", "lpt:file.txt", "USB001:file.txt" and
"USB002:file.txt" with the same (lack of) effect. "USB001:", "lpt:" and
"USB002:" cause the MS Visual C debugger to complain that the string
"USB001:", "lpt:" or "USB002:" is null.
Any thoughts?