Ok here's some code:
I first declared:
static HBITMAP loadLogo ;
static int cxClient, cyClient, cxSource, cySource;
BITMAP bitmap ;
HDC hdc, hdcMem ;
HINSTANCE hInstance ;
PAINTSTRUCT ps;
Then:
case WM_CREATE:
loadLogo=LoadBitmap(hInst, MAKEINTRESOURCE(402));
if(!loadLogo)
{
MessageBox(hwnd, "Error", "Error", 1);
}
GetObject(loadLogo, sizeof(loadLogo), &bitmap);
cxSource=bitmap.bmWidth;
cySource=bitmap.bmHeight;
break;
case WM_PAINT:
hdcMem=CreateCompatibleDC(hdc);
SelectObject(hdcMem, loadLogo);
BitBlt(hdc, 1, 1, 50, 50, hdcMem, 0, 0, SRCCOPY);
break;
case WM_DESTROY:
DeleteObject(loadLogo);
PostQuitMessage(0); /* send a WM_QUIT to the message queue */
break;
But it shows the error message that is used for if(!loadLogo), and it shows up, and then my BMP doesn't load. What do I do?



LinkBack URL
About LinkBacks


