Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ReBar control

Posted on 1998-08-12
9
Medium Priority
?
689 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

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 200 total points
ID: 1413402
Thanks
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

721 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