DIB example for C++ 4.0 and later

This example copies the Lead1 bitmap to the clipboard as a DIB. It pastes the DIB into Lead2 and reverses the image. It then gets a DIB from Lead2, sets the same DIB to Lead1, and repaints.

BeginWaitCursor();
int MyFlags = COPY_EMPTY + COPY_DIB + COPY_PALETTE;
m_Lead1.Copy(MyFlags);
m_Lead2.Paste(0);
m_Lead2.Reverse();
OLE_HANDLE MyDib = m_Lead2.GetDIB();
m_Lead1.SetDIB(MyDib);
m_Lead1.ForceRepaint();
GlobalFree((HGLOBAL) MyDib);
EndWaitCursor();