oh alright then here you go, this is the function i am having issues with...
Code:
void DrawBitmap(HDC hdcDest, char *filename, int x, int y)
{
HBITMAP image;
BITMAP bm;
HDC hdcMem;
//load the bitmap image
image = (void*)LoadImage(0,"c.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
//read the bitmap's properties
GetObject(image, sizeof(BITMAP), &bm);
//create a device context for the bitmap
hdcMem = CreateCompatibleDC(global_hdc);
SelectObject(hdcMem, image);
//draw the bitmap to the window (bit block transfer)
BitBlt(
global_hdc, //destination device context
x, y, //x, y location on destination
bm.bmWidth, bm.bmHeight, //width, height of source bitmap
hdcMem, //soource bitmap device context
0, 0, //start x,y on source bitmap
SRCCOPY); //blit method
//delete the device context and bitmap
DeleteDC(hdcMem);
DeleteObject((HBITMAP)image);
}
i posted the screen so that you could see what error i'm getting and all that stuff.
but for those who don't like to click the error i get is
In function 'void DrawBitmap(HDC__*, char*, int, int)'
invalid conversion from 'void*' to 'HBITMAP__*'
[Build Error] [winmain.o] Error 1
thanks for any help.
EDIT: just saw the next post. i don't know why, i copied this code from a cd included with the book i'm learning out of. but removing the (void*) casting still produces the same error.