
puzzled by adding a bitmap to a button
Quote:
> I have two buttons in my dialog.
> Now I want to add bitmaps to the buttons.
> It seems pretty straight forward. Just load bitmap and SetBitmaps.
> However, during the test runs, the bitmaps never show up.
> The code is cut from InitDialog function.
> CBitmap bmpAdd;
> ASSERT(bmpAdd.LoadBitmap(MAKEINTRESOURCE(IDB_mess))!=0);
> CBitmap bmpDel;
> ASSERT(bmpDel.LoadBitmap(MAKEINTRESOURCE(IDB_mess))!=0);
> m_AddMem.SetBitmap( (HBITMAP) bmpAdd );
> m_DelMem.SetBitmap( (HBITMAP) bmpDel );
> Any suggestions?
> Thanks.
> Cao.
Just quickly, I wonder if you have the correct style set for the button
to use bitmaps. Also, the code that you have above will fail in the
release version because you've included executable code in an ASSERT
macro. You might want to change that...
Cecil
--
Cecil Galbraith
Free programmer's utilities and MFC tips at
http://www.*-*-*.com/ ~cgalbrai