Thread: MFC CWnd::OnPaint() Issue

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    35

    MFC CWnd::OnPaint() Issue

    I have a dialog in which I draw and fill a rectangle with a colour in the OnPaint method of the dialog. When I run my application the dialog is displayed and I see the rectangle being drawn and filled, but then it disappears. If I drag another window on top of it I can see the rectangle filled, but not the other controls of the dialog. Finally if after dragging another window over top of the dialog and back off if I move the dialog the other controls come back but the rectangle disappears again.

  2. #2
    Registered User
    Join Date
    May 2006
    Posts
    35
    In typing out the above it occurred to me that I may be using the wrong device context, after testing I was correct.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WIndows programming?
    By hostensteffa in forum Windows Programming
    Replies: 7
    Last Post: 06-07-2002, 08:52 PM
  2. Release MFC Programs & Dynamic MFC DLL :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 05-18-2002, 06:42 PM
  3. Understanding The Future of MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 04-15-2002, 09:08 PM
  4. Beginning MFC (Prosise) Part III - Now What? :: C++
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 03-03-2002, 06:58 PM
  5. MFC is Challenging :: C++
    By kuphryn in forum C++ Programming
    Replies: 8
    Last Post: 02-05-2002, 01:33 AM