Solved

ReBar control

Posted on 1998-08-12
9
651 Views
Last Modified: 2013-12-03
Hi,
I'm having a little problem getting new ReBar control to work.  I think I've followed the instructions pretty well but it still won't work.
I'll go over what I've been doing:

I call InitCommonControlsEx() specifying ICC_COOL_CLASSES|ICC_BAR_CLASSES.

I create the ReBar control using CreateWindowEx().
hRebar = CreateWindowEx()...
- dwStyle = WS_CHILD|WS_VISIBLE|RBS_BANDBORDERS|CBRS_ALIGN_ANY.
- dwExStyle = WS_EX_TOOLWINDOW.
- hwndParent = m_hWnd (handle to main frame).
- ClassName = REBARCLASSNAME.
The ReBar gets created.

I create a REBARINFO structure, RBinfo.
- cbSize = sizeof(REBARINFO);
- fMask  = 0;
- himl   = (HIMAGELIST)NULL;

Send the ReBar a message to intitialize.
::SendMessage(hRebar, RB_SETBARINFO, 0, (LPARAM)(REBARINFO*)&RBinfo);

I figured that I should have a CWnd around to wrap the ReBar so I have a CWnd member m_wndReBar.
m_wndReBar.Attach(h_Rebar);

Now I create my ToolBar, passing it the wrapper CWnd& of the ReBar as it's owner.
m_wndToolBar.Create(&m_wndReBar);
m_wndToolBar.LoadToolBar(IDR_MAINFRAME));

Now, I want to let the ReBar know that my m_wndToolBar is it's child and will be in the bar.

I create a REBARBANDINFO called RBBinfo.
- cbSize = sizeof(REBARBANDINFO);
- fMask = RBBIM_CHILD  | RBBIM_CHILDSIZE;// child will be ToolBar
- cxMinChild = 100 (arbitrary.  Just testing it)
- cyMinChild = 50  (arbitrary.  Just testing it)
- hwndChild = m_wndToolBar.m_hWnd;  (handle to ToolBar)

Now I send the ReBar a message to add my ToolBar band.
::SendMessage(hRebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)(REBARBANDINFO*)&RBBinfo);

After all this, I figured everything would be fine, but the ReBar is not there.  It gets drawn but it's not there.  It's drawn at the top but I can erase the picture of the ReBar (with the ToolBar inside it) with a MDI frame.

What have I done wrong?
Why is the rebar just a picture of a Rebar and no real?

Thanks
0
Comment
Question by:bod_1
  • 5
  • 3
9 Comments
 
LVL 6

Expert Comment

by:WxW
ID: 1413394
If you want I will mail you the Rebar example that I read and modify to suit my rebar
0
 
LVL 2

Expert Comment

by:lucidity
ID: 1413395
There is an excellent rebar control at
http://www.geocities.com/SiliconValley/Haven/8230/index.html
used in the Internet Explorer 4.0 IDE.
0
 

Author Comment

by:bod_1
ID: 1413396
Hey WxW, Lucidity,
wassup?
Yeah, I've seen Kirk Stowell's samples (linked from codeguru), but they all seem to link to his library. Don't get me wrong, he does good stuff, but I just like to write my own code and it's hard to see what the ReBar's doing because of all of the intermediary classes.
I tried it again for a few minutes;
Now I get a fully functional Rebar with a toolbar class (WS_EX_TRANSPARENT) inside it but the toolbar keeps painting over the Rebar's background bitmap.
Also, the ReBar (RBS_AUTOSIZE) doesn't size with the frame window...
WxW, that example would be much appreciated,
it would be good if the ReBar had a control class inside it with a background bmp, or a tip, whatever; just so I can figure out what's going on.

bod_1@hotmail.com

Thanks
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Author Comment

by:bod_1
ID: 1413397
WxW,
I just went to my mailbox, tried to retreive the zip files but it seems my server is having a few problems.
Thanks for the files though.
I'll post here again when they fix whatever the problem is.
0
 

Author Comment

by:bod_1
ID: 1413398
WxW,
I can't download the zip files.  The server said something about Back Orifice (hehe.  Joke).
Could you mail them to my other account?
gced@passport.ca
Thanks
0
 
LVL 6

Expert Comment

by:WxW
ID: 1413399
done
0
 

Author Comment

by:bod_1
ID: 1413400
Thanks WxW,
Sorry about the time, I was away.

I'll reopen question for you.
Thanks again
0
 

Author Comment

by:bod_1
ID: 1413401
-
0
 
LVL 6

Accepted Solution

by:
WxW earned 50 total points
ID: 1413402
Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question