diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index f53d6d84f7..c5c2a08b64 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -295,14 +295,19 @@ int wxDC::GetDepth() const void wxDC::Clear() { RECT rect; - if (m_canvas) - GetClientRect((HWND) m_canvas->GetHWND(), &rect); - else if (m_selectedBitmap.Ok()) + if ( m_canvas ) { + GetClientRect((HWND) m_canvas->GetHWND(), &rect); + } + else + { + wxCHECK_RET( m_selectedBitmap.Ok(), _T("this DC can't be cleared") ); + rect.left = 0; rect.top = 0; rect.right = m_selectedBitmap.GetWidth(); rect.bottom = m_selectedBitmap.GetHeight(); } + (void) ::SetMapMode(GetHdc(), MM_TEXT); DWORD colour = GetBkColor(GetHdc());