Click here to Skip to main content
15,905,325 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Searching for direction Pin
Neville Franks4-Oct-03 12:14
Neville Franks4-Oct-03 12:14 
GeneralRe: Searching for direction Pin
Peter Weyzen3-Oct-03 9:25
Peter Weyzen3-Oct-03 9:25 
GeneralRe: Searching for direction Pin
Adam °Wimsatt3-Oct-03 9:51
Adam °Wimsatt3-Oct-03 9:51 
GeneralRe: Searching for direction Pin
Peter Weyzen3-Oct-03 9:56
Peter Weyzen3-Oct-03 9:56 
GeneralFFT Pin
AdventureBoy3-Oct-03 5:56
AdventureBoy3-Oct-03 5:56 
GeneralRe: FFT Pin
Adam °Wimsatt3-Oct-03 6:00
Adam °Wimsatt3-Oct-03 6:00 
GeneralRe: FFT Pin
Orhun Birsoy3-Oct-03 8:34
Orhun Birsoy3-Oct-03 8:34 
QuestionWhy does my stretchblt always fail? Pin
Jason Henderson3-Oct-03 5:16
Jason Henderson3-Oct-03 5:16 
CClientDC clientDC(this);
CDC memDC;
CDC srcDC;
CBitmap* pOldSrcBmp = NULL;
CRect rect;
BITMAP bmp;

GetClientRect(&rect);

memDC.CreateCompatibleDC(&clientDC);
srcDC.CreateCompatibleDC(&clientDC);

pOldSrcBmp = srcDC.SelectObject(&myBitmap);

myBitmap.GetBitmap(&bmp);
BOOL bTest = memDC.StretchBlt(0, 0, rect.Width(), rect.Height(), &srcDC, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);

srcDC.SelectObject(pOldSrcBmp);

memDC.DeleteDC();
srcDC.DeleteDC();

myBitmap is a CBitmap that has successfully loaded.
This always fails unless I'm in OnDraw or OnPaint. What gives?

"It is better to remain silent and be thought a fool than to open one's mouth and remove all doubt." - Abraham Lincoln
Jason Henderson
blog | articles

AnswerRe: Why does my stretchblt always fail? Pin
PJ Arends3-Oct-03 6:44
professionalPJ Arends3-Oct-03 6:44 
Generalarrays Pin
NewHSKid3-Oct-03 5:14
NewHSKid3-Oct-03 5:14 
GeneralRe: arrays Pin
jmkhael3-Oct-03 5:39
jmkhael3-Oct-03 5:39 
GeneralRe: arrays Pin
Adam °Wimsatt3-Oct-03 5:44
Adam °Wimsatt3-Oct-03 5:44 
GeneralRe: arrays Pin
Ian Darling3-Oct-03 5:56
Ian Darling3-Oct-03 5:56 
GeneralDetermine when I am connected on LAN Pin
Alan Martinis3-Oct-03 4:00
Alan Martinis3-Oct-03 4:00 
GeneralRe: Determine when I am connected on LAN Pin
Ravi Bhavnani3-Oct-03 5:24
professionalRavi Bhavnani3-Oct-03 5:24 
GeneralRe: Determine when I am connected on LAN Pin
Alexander M.,3-Oct-03 7:42
Alexander M.,3-Oct-03 7:42 
GeneralRe: Determine when I am connected on LAN Pin
Alexander M.,3-Oct-03 7:41
Alexander M.,3-Oct-03 7:41 
GeneralRe: Determine when I am connected on LAN Pin
Alan Martinis3-Oct-03 7:45
Alan Martinis3-Oct-03 7:45 
GeneralRe: Determine when I am connected on LAN Pin
pma3-Oct-03 7:54
pma3-Oct-03 7:54 
GeneralRe: Determine when I am connected on LAN Pin
Alan Martinis3-Oct-03 8:07
Alan Martinis3-Oct-03 8:07 
GeneralRe: Determine when I am connected on LAN Pin
pma3-Oct-03 8:51
pma3-Oct-03 8:51 
GeneralClickable Bitmap UI question Pin
b_girl3-Oct-03 3:58
b_girl3-Oct-03 3:58 
GeneralRe: Clickable Bitmap UI question Pin
Jason Henderson3-Oct-03 5:12
Jason Henderson3-Oct-03 5:12 
GeneralRe: Clickable Bitmap UI question Pin
b_girl3-Oct-03 5:37
b_girl3-Oct-03 5:37 
GeneralRe: Clickable Bitmap UI question Pin
Jason Henderson3-Oct-03 5:45
Jason Henderson3-Oct-03 5:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.