Solved

Invalidating the Window From OnPaint or OnDraw

Posted on 1997-06-24
1
530 Views
Last Modified: 2013-11-19
Is it possible to call Invalidate either directly or via a method in OnPaint or OnDraw.  I receive an assertion error when I try.  If I cannot please explain why.  Thank you...

ERIK SUTCLIFFE  
0
Comment
Question by:darman
1 Comment
 
LVL 23

Accepted Solution

by:
chensu earned 100 total points
ID: 1302288
Yes, you can. Simply try the following code in your OnDraw:

pDC->TextOut(0, 0, CString("ABCDEFGHIJKL"));
this->Invalidate();

The program will be busy sending WM_PAINT message.

What is the assertion error?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Rewrite URL With Encoded Characters 6 74
Unix / Linux grid computing 5 144
C++ BOOL WINAPI ReadFile fails on windows 10 when reading from USB cable 9 371
EvenOdd challenge 10 88
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now