1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Visual Studio 2008 and MFC Feature Pack

Discussion in 'Software Development' started by Roxoff, Jun 9, 2008.

Thread Status:
Not open for further replies.
  1. Roxoff

    Roxoff Thread Starter

    Jun 9, 2008
    Hi there

    We (i.e. me and my colleagues at work) have come across a very odd problem with the latest MFC feature pack and the latest Microsoft IDE, and wondered if anyone else had seen this and even could suggest a work around.

    We had a redraw problem with OnPaint and OnDraw of our document class. the problem was that if any part of the view was invalidated, it would cause the whole view panel to be redrawn - problem is our application can have huge documents and take a few seconds to redraw, and this was happening even if the user popped an about box or a file save box over the view, which would then hang for several seconds doing a redraw of the view with the same image that was already there.

    After spending far too long investigating this phenomenon, we tried to reproduce this with an app-wizard generated MDI project. None of our existing code in there, just a loop in OnDraw that dropped ellipses over one another, enough to tie up the draw process for a second or so and that would be visible to the naked eye. All we had to do was do a 'file->open' to pop the standard file dialog and watch the redraw around the outside of its box. And it turned up.

    This never used to happen with earlier versions of MFC - if you popped a dialog over your view, it never needed to invalidate the whole view and cause a re-draw. It just drew the dialog box.

    Some deeper investigation showed that bypassing the PaintDC/MFC overhead in the OnPaint handler and using ::BeginPaint(...), the invalid rectangle for the CView-derived panel equated to the whole client area, and there should have been no change to any of that. This just wasn't the case for earlier versions of MFC which allowed small sections of the view to be redrawn as needed.

    Has anyone else seen this effect? Can anyone help with a workaround?
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/719841

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice