Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ReBar control

Posted on 1998-08-12
9
Medium Priority
?
703 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
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

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…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

877 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