We help IT Professionals succeed at work.

TextOut

stucox
stucox asked
on
Medium Priority
511 Views
Last Modified: 2013-11-20
I want to use TextOut with the fMode parameter set to TA_UPDATECP. However my newline characters do not work on the printer i.e. they do not update the CP. How do I get newlines/line feeds to work with TextOut?

Thanks.
Comment
Watch Question

Commented:
Use CDC::DrawText function.

Commented:
As noted, you should use DrawText instead.

TextOut is low-level.  If you want to use it and need the newlines etc. to be handled properly, you'll need to fix them yourself.

DrawText is higher level and Windows fixes up special characters for you.
I always though TextOut just called DrawText.  In any case the doco says that it handles TA_UPDATECP.

Correct me if I am wrong but I think the real "problem" is that once you use TA_UPDATECP then you are giving up any "multi-line" capability.  What would a CR be expected to do?

Explore More ContentExplore courses, solutions, and other research materials related to this topic.