title: OnDraw not getting called
body: <p>I'm trying to display an image in <code>CScrollView</code>-derived class:</p>
  
  <p><a href="https://stackoverflow.com/questions/39957200/c-cscrollview-how-to-scroll-an-image">C++ CScrollView, how to scroll an image?</a></p>
  
  <p>So I want to override <code>OnDraw</code>, to move the code from <code>OnPaint</code> to <code>OnDraw</code>. But I can't. Every time I call <code>Invalidate()</code> only <code>OnPaint</code> is getting called.</p>
  
  <pre><code>void CCardioAppView::OnDraw(CDC* pDC)
  {
  
  }
  
  void CCardioAppView::OnPaint()
  {
      if (theApp.ImageFolderPath == _T("")) return;
  //---------------------метод № 2 с CPictureHolder-------------------------------
      CPaintDC dc(this);
      CBitmap bmp;
      BITMAP b;
      HBITMAP hbitmap;
      CRect rect;
      auto bmp_iter = theApp.FullBmpMap.find(m_iCurrentImage);
  
      if (bmp_iter == theApp.FullBmpMap.end()) return;
  
      hbitmap = bmp_iter-&gt;second; 
      bmp.Attach((*bmp_iter).second);
      bmp.GetObject(sizeof(BITMAP), &amp;b);
  
      GetClientRect(&amp;rect);
      scaleRect = rect;
      OriginalWidth = b.bmWidth;
      OriginalHeight = b.bmHeight;
      if (rect.Height() &lt;= b.bmHeight)
          scaleRect.right = rect.left + ((b.bmWidth*rect.Height()) / b.bmHeight);
      else if (rect.Height() &gt; b.bmHeight)
      {
          scaleRect.right = b.bmWidth;
          scaleRect.bottom = b.bmHeight;
      }
      scaleRect.right = scaleRect.right + scale_koef_g;
      scaleRect.bottom = scaleRect.bottom + scale_koef_v;
  
      pic.CreateFromBitmap(hbitmap);
      pic.Render(&amp;dc, scaleRect, rect);
  
      (*bmp_iter).second.Detach();
      (*bmp_iter).second.Attach(bmp);
      bmp.Detach();
  
      int isclWidth = scaleRect.Width();
      int isclHeight = scaleRect.Height();
      int irHeight = rect.Height();
      int irWidth = rect.Width();
  
      if ((isclWidth&gt; irWidth)||(isclHeight &gt; irHeight))
      {
          SetScrollSizes(MM_TEXT, CSize(isclWidth, isclHeight));
      }
      else SetScrollSizes(MM_TEXT, CSize(irWidth, irHeight));
  }
  </code></pre>