Click here to Skip to main content
15,884,061 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear sir:
I meet a big problem when I try to load a bmp picture as background in CRebar with VC2008 but the bmp picture cannot be displayed,while I could implement it easily with VC6++. I paste the code here, and hope I could get a hand.
Yours sincerely
whhans.

C++
CRebar m_wndReBar;
m_wndReBar.Create(this); 
m_wndReBar.AddBar(m_wndToolBar);
REBARBANDINFO rbbi;
rbbi.cbSize = sizeof(rbbi); 
rbbi.fMask = RBBIM_CHILDSIZE | RBBIM_IDEALSIZE | RBBIM_SIZE|RBBIM_BACKGROUND;
rbbi.cxMinChild = rectToolBar.Width();
rbbi.cyMinChild = rectToolBar.Height();
rbbi.hbmBack = LoadBitmap(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_TOOLBARBKMAP));
rbbi.cx = rbbi.cxIdeal = rectToolBar.Width() * 10;
m_wndReBar.GetReBarCtrl().SetBandInfo(0, rbbi);
Posted
Updated 5-Jul-11 19:24pm
v4
Comments
Sergey Alexandrovich Kryukov 5-Jul-11 4:05am    
Are you sure this is C++/CLI. It looks like C++, and CRebar used to be MFC; I never heard of .NET CRebar. What is it?
--SA
Richard MacCutchan 5-Jul-11 6:04am    
You're correct, this is obviously MFC code.
Sergey Alexandrovich Kryukov 6-Jul-11 17:41pm    
Yes. Thank you, Richard.
--SA
Richard MacCutchan 5-Jul-11 6:05am    
What big problem? Unless you explain what is going wrong it's unlikely anyone can offer much help.
enhzflep 5-Jul-11 10:11am    
Just like Richard asks, what "big problem"?

1. Download source code for Win32++
2. Make and run examples
3. Isolate code with same functionality
4. Understand code
5. Re-implement in a way that fits with the rest of your application.

1 solution

you havent set the fStyle, maybe the bmp has the wrong bit-width
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900