Solved

ReBar control

Posted on 1998-08-12
9
618 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:bod_1
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:bod_1
Comment Utility
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
Comment Utility
done
0
 

Author Comment

by:bod_1
Comment Utility
Thanks WxW,
Sorry about the time, I was away.

I'll reopen question for you.
Thanks again
0
 

Author Comment

by:bod_1
Comment Utility
-
0
 
LVL 6

Accepted Solution

by:
WxW earned 50 total points
Comment Utility
Thanks
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now