ColorRes example for C++ 4.0 and later

This example checks to see if the bitmap is 8 bits per pixel and converts it if it is not.

if (m_Lead1.GetBitmapBits() != 8)
{
  BeginWaitCursor();
  m_Lead1.ColorRes(8, CRP_OPTIMIZEDPALETTE, CRD_FLOYDSTEINDITHERING, 0);
  m_Lead1.ForceRepaint();
  EndWaitCursor();
}