Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 563
  • Last Modified:

Invalidating the Window From OnPaint or OnDraw

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
darman
Asked:
darman
1 Solution
 
chensuCommented:
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now