WM_Paint Redrawing an area 
Author Message
 WM_Paint Redrawing an area

Hello,

I was happily playing around with a new program and decided to
add some code to redraw an area of the screen when windows
tells me to (ie when its gone off the screen or needs re-drawing)
I added a WM_PAINT windows message handler to CProgView,
and it created this:

void CAPaintView::OnPaint()
{
 CPaintDC dc(this); // device context for painting
 // TODO: Add your message handler code here
 // Do not call CView::OnPaint() for painting messages

Quote:
}

When I run it, I get the old:
"Debug Assertion Failed!", "File: afxwin1.inl" "Line: 747"
which is:
" { ASSERT(m_hDC != NULL); return ::BitBlt(m_hDC, x, y, nWidth, nHeight,
  pSrcDC->GetSafeHdc(), xSrc, ySrc, dwRop); }"

Now I am doing some BitBlt work, but OnPaint is empty (as
above). If I remove this handle the program works okay.
Can anyone please help? Do I need to paste more code?

--

Thanks

Just



Tue, 13 Sep 2005 10:44:27 GMT  
 WM_Paint Redrawing an area
the line BitBlt should use the value dc instead of m_hDC

On Fri, 28 Mar 2003 09:44:27 +0000 (UTC), "Justin Bright"

Quote:

>Hello,

>I was happily playing around with a new program and decided to
>add some code to redraw an area of the screen when windows
>tells me to (ie when its gone off the screen or needs re-drawing)
>I added a WM_PAINT windows message handler to CProgView,
>and it created this:

>void CAPaintView::OnPaint()
>{
> CPaintDC dc(this); // device context for painting
> // TODO: Add your message handler code here
> // Do not call CView::OnPaint() for painting messages
>}

>When I run it, I get the old:
>"Debug Assertion Failed!", "File: afxwin1.inl" "Line: 747"
>which is:
>" { ASSERT(m_hDC != NULL); return ::BitBlt(m_hDC, x, y, nWidth, nHeight,
>  pSrcDC->GetSafeHdc(), xSrc, ySrc, dwRop); }"

>Now I am doing some BitBlt work, but OnPaint is empty (as
>above). If I remove this handle the program works okay.
>Can anyone please help? Do I need to paste more code?



Thu, 15 Sep 2005 01:12:31 GMT  
 WM_Paint Redrawing an area
Hello,

But that's an include provided by microsoft!
Should I change it?!

--

Thanks

Just

Quote:
> the line BitBlt should use the value dc instead of m_hDC

> On Fri, 28 Mar 2003 09:44:27 +0000 (UTC), "Justin Bright"

> >Hello,

> >I was happily playing around with a new program and decided to
> >add some code to redraw an area of the screen when windows
> >tells me to (ie when its gone off the screen or needs re-drawing)
> >I added a WM_PAINT windows message handler to CProgView,
> >and it created this:

> >void CAPaintView::OnPaint()
> >{
> > CPaintDC dc(this); // device context for painting
> > // TODO: Add your message handler code here
> > // Do not call CView::OnPaint() for painting messages
> >}

> >When I run it, I get the old:
> >"Debug Assertion Failed!", "File: afxwin1.inl" "Line: 747"
> >which is:
> >" { ASSERT(m_hDC != NULL); return ::BitBlt(m_hDC, x, y, nWidth, nHeight,
> >  pSrcDC->GetSafeHdc(), xSrc, ySrc, dwRop); }"

> >Now I am doing some BitBlt work, but OnPaint is empty (as
> >above). If I remove this handle the program works okay.
> >Can anyone please help? Do I need to paste more code?



Thu, 15 Sep 2005 10:43:16 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. what exactly is redrawn on WM_PAINT

2. Redraw text in the client area

3. ...spill area in conflict with parameter area...

4. plot-area and control-area and

5. Subclassing WM_PAINT message in CEdit

6. How to paint over child window in WM_PAINT

7. WM_CTLCOLORDLG / WM_PAINT problem

8. WM_PAINT????

9. not painting a rectangle (WM_PAINT, MFC problem)

10. new to windows - WM_PAINT question

11. WM_PAINT, GDI, CreateCompatibleDC, that sort of thing

12. How to post WM_PAINT from another thread?

 

 
Powered by phpBB® Forum Software