Change bitmap in CStatic?

Hi,
I try to change the bitmap of a CStatic control like this:
m_StatusBmp.SetBitmap( ::LoadBitmap( NULL, MAKEINTRESOURCE(IDB_MYBITMAP) ) );
But the existing bitmaps disappears and the new one is not shown.
What could be wrong?
Please help.
[275 byte] By [MolleX] at [2007-11-17 0:47:14]
# 1 Re: Change bitmap in CStatic?
Try this:

CBitmap Bitmap;
m_StatusBmp.SetBitmap( Bitmap.LoadBitmap(IDB_MYBITMAP) );

Hope this helps.

Brandon
baheath at 2007-11-10 6:46:25 >
# 2 Re: Change bitmap in CStatic?
That gives the following error:
error C2664: 'SetBitmap' : cannot convert parameter 1 from 'int' to 'struct HBITMAP__ *'

The only way I have found to get hold of a HBITMAP is through ::LoadBitmap...
MolleX at 2007-11-10 6:47:25 >
# 3 Re: Change bitmap in CStatic?
Sorry. This should work.

m_StatusBmp.SetBitmap(::LoadBitmap(AfxGetResourceHandle(), MAKEINTRESOURCE(IDB_MYBITMAP)) );

Brandon
baheath at 2007-11-10 6:48:24 >