Click to See Complete Forum and Search --> : RectVisible and Debugging


Sean
May 20th, 1999, 01:22 AM
I recently posted a question here about OnDraw and RectVisible so thanks to all who answered it.
Now for my new question.....
In my OnDraw function I use RectVisible to see if I need to draw certain objects, but when I am in debugging mode, RectVisible always returns false even though if I was running the program normally it would return true. I understand that because VC takes up the full screen, then there is no need for my application to draw objects - but in this case this defeats the purpose of me debugging. Can somebody please offer a solution?
Thanks,
Sean.

Jason Teagle
May 20th, 1999, 02:15 AM
Rather than put a breakpoint before the RectVisible() and try to step through it, add a piece of code which writes "TRUE" or "FALSE" either to your app's status bar (CMainFrame::SetMessageText() ) or to the VC++ debugging window (use TRACE() for this) to show the outcome of the RectVisible() function, and put the breakpoint after the call, if you still need it. Normally I use message boxes to indicate things I can't trace, but for painting issues this causes more problems because the window needs repainting after the message box has gone!

It is also helpful, if the call appears in more than one place, to indicate WHERE it occured as well; for example, you could write "First call" and "Second call" to distinguish between them.

Also, for the debugging window you will need to add "\n" to the output for each line, otherwise everything gets crunched onto one line.

Does this help?