a bitmap : IDB_BITMAP1,
I load it by :
HBITMAP hBmp1 = (HBITMAP)::LoadImage(NULL,
MAKEINTRESOURCE(IDB_BITMAP1),
IMAGE_BITMAP,
0,
0,
LR_LOADFROMFILE);
But hBmp1 is NULL, whats why?
CBitmap bm;
bm.LoadBitmap(IDB_BITMAP1);
HBITMAP hBmp1 = (HBITMAP)bm.Detach();
// but you know you must delete this HBITMAP handle,otherwise there must have a memory leak .