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...
I think it's the GetWindowRect functionCode: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(); }
any suggestions?





Reply With Quote