my app always performs an illegal operation and crashes. I'm sure I know WHERE to find the mistake but I don't know how to fix it...

Code:
void CChildView::OnPaint() 
{
	CPaintDC dc(this);
	LPRECT wRect;
	CBitmap Bitmap;

	Bitmap.LoadBitmap(MAKEINTRESOURCE(IDB_BITMAP2));
	CDC MemDC;
	MemDC.CreateCompatibleDC(&dc);
	CBitmap * pOldBitmap = MemDC.SelectObject(&Bitmap);
	GetWindowRect(wRect);
	
	dc.BitBlt(300, 200,100, 100, &MemDC, 0, 0, SRCCOPY);
	dc.SelectObject(pOldBitmap);
	Bitmap.DeleteObject();
}
I think it's the GetWindowRect function
any suggestions?