Harvey
Harvey

Reputation: 2222

How to see output of TextOutW(...) after each call?

On writing to the display with:

::TextOutW( pDC->m_hDC, x, y, &Out, 1 );

It only shows on the screen after every 15 calls (15 characters). For debugging purposes only, I would like to see the new character on the display after each call. I have tried ::flushall() and a few other things but no change. TIA

Upvotes: 2

Views: 654

Answers (2)

Jerry Coffin
Jerry Coffin

Reputation: 490573

::flushall() is for iostreams, so it won't affect Windows screen output at all. I've never tried it, but based on the docs, I believe GDIFlush() might be what you want. You should also be able to use GDISetBatchLimit(1); to force each call to run immediately upon being called.

Upvotes: 1

interjay
interjay

Reputation: 110172

GDI function calls are accumulated and called in batches for performance reasons. You can call GdiFlush after the TextOut call to perform the drawing immediately. Alternatively, call GdiSetBatchLimit(1) before outputting the text to disable batching completely.

Upvotes: 1

Related Questions