TC++ & DeskJet+ graphics programming: can't print '\x1a' !!??

Rob Kurver rob at pact.nl
Sun Jun 23 22:28:02 AEST 1991


In <1991Jun22.080947.504 at cavebbs.gen.nz> frank at cavebbs.gen.nz (Frank van der Hulst) writes:

>In article <1991Jun21.040657.3195 at ux1.cso.uiuc.edu> mdcg7180 at uxa.cso.uiuc.edu (Michael David Carr) writes:
}>I'm trying to print graphics on a DeskJet+, and am having no problems
}>except that I can't send ASCII 26 in a string of graphics bytes.
}>
}>Any help would be greatly appreciated (HP and Borland have no clue).

}The problem lies with TC++ (and TC and Turbo-Pascal going back at least 5
}years). The stdprn stream is opened as text mode, not binary, so a \x1A acts
}as an EOF character (just like a disk text file). You need to re-open stdprn
}in binary mode. I have code (elsewhere) which does this by doing a DOS call
}via int 21h (from vague memory) because TC won't allow you to change the
}device's mode.

Can't you just ignore stdprn and simply open a new stream to the printer in
binary mode?

Cheers. - Rob
--
     PACT                   Rob Kurver
    Foulkeslaan 87         rob at pact.nl
   2625 RB Delft    tel: +31 15 616864 
  The Netherlands   fax: +31 15 610032



More information about the Comp.lang.c mailing list