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

Frank van der Hulst frank at cavebbs.gen.nz
Sat Jun 22 18:09:47 AEST 1991


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.

I can post the code (its only about 10 lines) if you need it.

Frank.


-- 

Take a walk on the wild side, and I don't mean the Milford Track.
Kayaking: The art of appearing to want to go where your boat is taking you.



More information about the Comp.lang.c mailing list