DDB example for C++ 5.0 and later

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

ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
                 IID_ILEADRasterProcess, (void**)&pRasterProc);

BeginWaitCursor();
int MyFlags = COPY_EMPTY + COPY_DDB + COPY_PALETTE;
m_LEADRasterView1.GetRaster().Copy((RasterCopyConstants)MyFlags);
m_LEADRasterView2.GetRaster().Paste(0);
pRasterProc->Reverse(m_LEADRasterView2.GetRaster());
long MyDC = m_LEADRasterView2.GetClientDC();
long MyDDB = m_LEADRasterView2.GetRaster().GetDDB(MyDC);
long MyPalette = m_LEADRasterView2.GetPalette(MyDC);
m_LEADRasterView1.GetRaster().SetDDB(MyDC, MyDDB, MyPalette);
m_LEADRasterView1.ForceRepaint();
m_LEADRasterView2.ReleaseClientDC();
DeleteObject((HBITMAP) MyDDB);
DeleteObject((HPALETTE) MyPalette);
pRasterProc->Release();
EndWaitCursor();