Link to home
Start Free TrialLog in
Avatar of dave_p
dave_p

asked on

.bmp on CButton

I am developing a MFC app. I have a CButton on a form. I have never done this before, I would like to put a .bmp on a CButton object. I scanned something and have it in .bmp format. A member function on CButton is: SetBitmap which takes a bitmap object. I can't figure out how to get the bitmap object from a .bmp file. Can somebody give me a little step by step on how to do this? Do I have to "import" this .bmp into my resources?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Recez
Recez

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dave_p
dave_p

ASKER

Well heck, it didn't display the bitmap. I did what you suggrest except I had
to

m_CB_weldedshock.SetBitmap(HBITMAP(bitMap));

since bitMap.m_hObject wasn't liked by the compiler. I didn't mention it but
I'm using VC++ 4.2 (I have to) so maybe that answers that. Anyway, the
bitmap was imported fine except it looks to be a "negative" of what I
scanned but I will cross that bridge when I get to it. In any event, the
push button just plain does not display the bitmap. What could I be
forgetting?

Thanks again!

Dave P
Avatar of dave_p

ASKER

Thanks! Excellant help.