1. Take a Dialog based application.
2. Declare a varible in the Dialog header class as HANDLE m_hBmp.
3. Go to the OnInitDialog and add the following line at the last
m_hBmp = ::LoadImage(NULL,"E:\\flowers.bmp",IMAGE_BITMAP,NULL,NULL,LR_LOADFROMFILE|LR_DEFAULT SIZE);
4. Now put the following in the OnPaint method
CDC dcSrc; dcSrc.CreateCompatibleDC(NULL); dcSrc.SelectObject(m_hBmp); dc.StretchBlt(0,0,100,100,&dcSrc,0,0,100,100,SRCCOPY);
See if it works.
Now substitute your code slowly into the working app and find where is the prob.