Hi,

I'm trying to figure out how, once you've drawn stuff in a window, to keep it in there semi-permanently. After reading around a bit it seems that you can use BitBlt to restore stuff that was wiped when the window was last updated. But after looking it up on msdn, I'm having a lot of trouble understanding how to use it.

They give an example function describing how to use it here (scroll down about 3/4 of the way):

BitBlt

That example includes the line:

Code:
hbmOld = SelectObject(hdcSrc, hbm);
Are calls to SelectObject like that actually modifying hdcDst and hdcSrc? That's how it seems.

But the problem is, when I try to add this into my basic ass windows program, the compiler tells me there's a problem with lines such as:

Code:
hbmOld = SelectObject(hdcSrc, hbm);
It says:

"cannot convert from 'HGDIOBJ' to 'HBITMAP' Conversion from 'void*' to pointer to non-'void' requires an explicit cast"

Maybe it's something to do with how I declared hbm:

Code:
HBITMAP hbm = CreateCompatibleBitmap(hdc, 100, 100);
If anyone can help me understand any of what's going on with this I'd appreciate it. Thanks.