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;
// check for whether the bitmap is already selected into a device context
wxASSERT_MSG( !bitmap.GetSelectedInto() ||
- (bitmap.GetSelectedInto() == this),
+ (bitmap.GetSelectedInto() == GetOwner()),
wxT("Bitmap is selected in another wxMemoryDC, delete the first wxMemoryDC or use SelectObject(NULL)") );
m_selectedBitmap = bitmap;
return;
#ifdef __WXDEBUG__
- m_selectedBitmap.SetSelectedInto(this);
+ m_selectedBitmap.SetSelectedInto(GetOwner());
#endif
hBmp = (WXHBITMAP)::SelectObject(GetHdc(), (HBITMAP)hBmp);