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):
That example includes the line:
Are calls to SelectObject like that actually modifying hdcDst and hdcSrc? That's how it seems.Code:hbmOld = SelectObject(hdcSrc, hbm);
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:
It says:Code:hbmOld = SelectObject(hdcSrc, hbm);
"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:
If anyone can help me understand any of what's going on with this I'd appreciate it. Thanks.Code:HBITMAP hbm = CreateCompatibleBitmap(hdc, 100, 100);