Welcome to Stratos!
CDC cDC;cDC.CreateCompatibleDC( pSource );CBitmap cBmp, *pOldBmp;cBmp.CreateCompatibleBitmap( pSource, nWidth, nHeight );pOldBmp = cDC.SelectObject( &cBmp );cDC.BitBlt( 0, 0, nWidth, nHeight, pSource, 0, 0, SRCCOPY );// Aqui ya tenemos en el bitmap seleccionado el contenido de pSource......cDC.SelectObject( &pOldBmp );
Buen punto el de GetLastError(), pero no todas las funciones de Win32 se apoyan en ella, y lamentablemente estas no lo hacen :angry:
Return ValuesIf the function succeeds, and lpvObject is a valid pointer, the return value is the number of bytes stored into the buffer.If the function succeeds, and lpvObject is NULL, the return value is the number of bytes required to hold the information the function would store into the buffer.If the function fails, the return value is zero. To get extended error information, call GetLastError.