From: Simon on
When I'm debugging GDI calls it would be very helpful if every time my code
called a GDI function (e.g. Polyline) I could see immediately what effect it
has on the screen. Normally what happens is that you step over that line of
code and see nothing on the screen. In fact normally it isn't until I have
executed the entire paint function that I see the results. But by then it's
too late to determine which line of code did what.

I can understand why this is. But for debugging purposes, it would be very
handy if I could get the screen to update after each GDI call. Does anyone
know of any way of doing this? I use VC++ 6.

TIA

Simon



From: David Lowndes on
>When I'm debugging GDI calls it would be very helpful if every time my code
>called a GDI function (e.g. Polyline) I could see immediately what effect it
>has on the screen. Normally what happens is that you step over that line of
>code and see nothing on the screen. In fact normally it isn't until I have
>executed the entire paint function that I see the results. But by then it's
>too late to determine which line of code did what.

Hmm, I recall debugging painting code in the old 16-bit days and then
you could see what was being drawn as it was done.

Are you debugging on Vista? You could try switching off Aero and
seeing if that changes the situation. Failing that I wonder if
dropping the graphics card video acceleration setting may alter
things?

Dave
From: Charlie Brown on
The only way I ever did that was with remote debugging to a second machine in my office. Look at

http://www.codeproject.com/KB/debug/remotedebug.aspx

Charlie

"Simon" <Simon2(a)newsgroup.nospam> wrote in message news:S72dnQ7ueuzHjbXVnZ2dneKdnZydnZ2d(a)pipex.net...
> When I'm debugging GDI calls it would be very helpful if every time my code
> called a GDI function (e.g. Polyline) I could see immediately what effect it
> has on the screen. Normally what happens is that you step over that line of
> code and see nothing on the screen. In fact normally it isn't until I have
> executed the entire paint function that I see the results. But by then it's
> too late to determine which line of code did what.
>
> I can understand why this is. But for debugging purposes, it would be very
> handy if I could get the screen to update after each GDI call. Does anyone
> know of any way of doing this? I use VC++ 6.
>
> TIA
>
> Simon
>
>
>
From: ChrisN on
On Mon, 12 May 2008 10:38:36 +0100, "Simon" <Simon2(a)newsgroup.nospam>
wrote:

>When I'm debugging GDI calls it would be very helpful if every time my code
>called a GDI function (e.g. Polyline) I could see immediately what effect it
>has on the screen. Normally what happens is that you step over that line of
>code and see nothing on the screen. In fact normally it isn't until I have
>executed the entire paint function that I see the results. But by then it's
>too late to determine which line of code did what.
>
>I can understand why this is. But for debugging purposes, it would be very
>handy if I could get the screen to update after each GDI call. Does anyone
>know of any way of doing this? I use VC++ 6.
>
>TIA
>
>Simon
>

Hi Simon,

Try calling GdiSetBatchLimit(1) on the thread that does the drawing.
This disables GDI's internal batching, so each change should be
immediately visible.

Best regards,

Chris
From: Joseph M. Newcomer on
#ifdef _DEBUG
#define GDI_FLUSH() GdiFlush()
#else
#define GDI_FLUSH()
#endif

I do this all the time to debug graphics. Alternatively, you can set the GDI queue size
to 0 during the time you want to debug, but sometimes I don't care about six or ten GDI
calls in a row, so I just sprinkle the GDI_FLUSH() calls around whereever I'm debugging.

I've been doing this VC++ 4.2 so I know it works.
joe

On Mon, 12 May 2008 10:38:36 +0100, "Simon" <Simon2(a)newsgroup.nospam> wrote:

>When I'm debugging GDI calls it would be very helpful if every time my code
>called a GDI function (e.g. Polyline) I could see immediately what effect it
>has on the screen. Normally what happens is that you step over that line of
>code and see nothing on the screen. In fact normally it isn't until I have
>executed the entire paint function that I see the results. But by then it's
>too late to determine which line of code did what.
>
>I can understand why this is. But for debugging purposes, it would be very
>handy if I could get the screen to update after each GDI call. Does anyone
>know of any way of doing this? I use VC++ 6.
>
>TIA
>
>Simon
>
>
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm