bool wxMemoryDCImpl::CreateCompatible(wxDC *dc)
{
- wxDCImpl *impl = dc->GetImpl();
+ wxDCImpl *impl = dc ? dc->GetImpl() : NULL ;
wxMSWDCImpl *msw_impl = wxDynamicCast( impl, wxMSWDCImpl );
- if (!msw_impl)
+ if ( dc && !msw_impl)
{
m_ok = false;
return false;
::SelectObject(GetHdc(), (HBITMAP) m_oldBitmap);
if ( m_selectedBitmap.Ok() )
{
-#ifdef __WXDEBUG__
m_selectedBitmap.SetSelectedInto(NULL);
-#endif
m_selectedBitmap = wxNullBitmap;
}
}
if ( !hBmp )
return;
-#ifdef __WXDEBUG__
m_selectedBitmap.SetSelectedInto(GetOwner());
-#endif
hBmp = (WXHBITMAP)::SelectObject(GetHdc(), (HBITMAP)hBmp);
if ( !hBmp )