Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Invalidating the Window From OnPaint or OnDraw

Posted on 1997-06-24
1
535 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.

860 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