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