CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    45

    RectVisible and Debugging

    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.



  2. #2
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: RectVisible and Debugging

    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?



    --
    Jason Teagle
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured