MinGW strange compile error

I don't know why, but I can't get line 5 of this code to compile:

1
2
3
4
5
HDC hdc = GetDC (hwnd);
HDC cDC = CreateCompatibleDC (hdc);
HBITMAP hbmp = CreateCompatibleBitmap  (hdc, thrScene.xSize, -thrScene.ySize);
SetDIBits (hdc, hbmp, 0, thrScene.ySize, pixels, &info, DIB_RGB_COLORS);
hbmp = SelectObject (cDC, hbmp);



Code::Blocks (my IDE) tells me this is because:

error: invalid conversion from 'void*' to 'HBITMAP__*'

I really am at loss to see what I am doing wrong, as I have double-checked the parameters, and they seem to be fine.
Last edited on
Actually, I just realised I needed to cast SelectObject () to HBITMAP explicitly.
Solved (and don't I feel stupid)!
Topic archived. No new replies allowed.