CBitmap bmpHello;
bmpHello.LoadBitmap( IDB_HELLO );
// Calculate bitmap size using a BITMAP structure.
BITMAP bm;
bmpHello.GetObject( sizeof(BITMAP), &bm );
// Create a memory DC, select the bitmap into the
// memory DC, and BitBlt it into the view.
CDC dcMem;
dcMem.CreateCompatibleDC( pDC );
CBitmap* pbmpOld = dcMem.SelectObject( &bmpHello );
pDC->BitBlt( 10,10, bm.bmWidth, bm.bmHeight,
&dcMem, 0,0, SRCCOPY );
// Reselect the original bitmap into the memory DC.
dcMem.SelectObject( pbmpOld );