Hello. So...I wanna To load 3 bitmap`s in one function. Ant after that Select it from another function I did like that:
[lalala.h]
class Bitmap {
HBITMAP hBitmap;
public:
void Function1();
void Function2();
);
[lalala.cpp]
void Function1()
{
hBitmap = (HBITMAP)LoadImage(0, "a.bmp", IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE);
}
void Function2()
{
BITMAP BMP;
HDC hDC;
GetObject(hBitmap, sizeof(BMP), &BMP);
HDC BMPDC = CreateCompatibleDC(NULL);
hDC = GetDC(hBtn);
SelectObject(BMPDC, hBitmap);
BitBlt(hDC, 0, 0, 10, 10, BMPDC, 0, 0, SRCCOPY);
ReleaseDC(hBtn, hDC);
DeleteDC(BMPDC);
DeleteObject(hBitmap);
}
It`s just an example because real code a bit more confusion, but whatever... So I can`t SelectObject hBitmap :/ if I load hBitmap in Function2() it selects find... what`s wrong here? THNX C ya (: