|
-
November 28th, 2012, 04:01 PM
#8
Re: raw display
Your OnDraw implementation seems to be strange (not to say incorrect!)
Code:
void XDVView::OnDraw(CDC* dc)
{
CDocument* pDoc = GetDocument();
int ht;
int wh;
ht = Pbmp->bmiHeader.biHeight;
wh = Pbmp->bmiHeader.biWidth;
HDC hdc=::GetDC(m_hWnd);
SetDIBitsToDevice(hdc,0,0,(DWORD)wh,(DWORD)ht,0,0,0,
(WORD)ht,buf,Pbmp,DIB_RGB_COLORS);
}
Why do you SetDIBitsToDevice to ::GetDC() rather than to CDC* dc) passed in by the framework?
Besides, you leak the resources since you do not call the ReleaseDC
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|