15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Rebar & CControlBar

Ronald D. Patton -- rpatton@informix.com
Friday, January 31, 1997

Environment: NT 4.0, VC++ 4.2b

I have an interesting situation regarding implementation of
a CControlBar derived class called CReBar which, you 
guessed it, implements the MS Rebar control. The problem
is that some Rebar styles conflict with some CControlBar
styles. Specifically:

// REBAR styles from \inetsdk\include\commctrl.h
#define RBS_TOOLTIPS    0x00000100
#define RBS_VARHEIGHT   0x00000200
#define RBS_BANDBORDERS 0x00000400
#define RBS_FIXEDORDER  0x00000800

// ControlBar styles from \msdev\mfc\include\afxres.h
#define CBRS_BORDER_LEFT    0x0100L
#define CBRS_BORDER_TOP     0x0200L
#define CBRS_BORDER_RIGHT   0x0400L
#define CBRS_BORDER_BOTTOM  0x0800L

I have found a limited workaround for this problem
by creating the rebar with the rebar styles but resetting
the CControlBar cached m_dwStyle member to the CBRS 
styles. This makes the CControlBar happy because he
deals with this member variable rather than ::GetWindowLong().

My questions are:

1. Has anyone implemented the Rebar control in
an MFC App using another method?

2. Will MSVC 5.0 contain a "wrapper" for the Rebar
control?


Thanks in advance for any information,
Ron Patton




Mike Blaszczak -- mikeblas@nwlink.com
Sunday, February 02, 1997

At 10:30 1/31/97 -0600, Ronald D. Patton wrote:

>2. Will MSVC 5.0 contain a "wrapper" for the Rebar
>control?

Unfortunately, the rebar control is still implemented by a beta version
of COMCTL32.DLL, which isn't redistributable.  MFC won't implement
anything for that control (or any of the other controls in that DLL)
until the library is freely redistributable. 

You probably should consider this fact for your own application
before you continue pursuing your own application: if you make it
dependent on the new version of COMCTL32.DLL, you won't be able to
distribute the proper version of COMCTL32.DLL with your application.
The beta agreement might even indicate that you're restricted in
writing such an application.


.B ekiM
http://www.nwlink.com/~mikeblas/
These words are my own. I do not speak on behalf of Microsoft.
           This performance was not lip-synched.




Eric Haddan -- erich@pop1.anawave.com
Monday, February 03, 1997

[Mini-digest: 2 responses]


I don't think that the rebar control should be derived from CControlBar.  I would derive it from the CWnd Class.
The Toolbar control could be derived from CControlBar.

Eric

----------
From: 	Ronald D. Patton[SMTP:rpatton@informix.com]
Sent: 	Friday, January 31, 1997 8:30 AM
To: 	'mfc-l@netcom.com'
Subject: 	Rebar & CControlBar

Environment: NT 4.0, VC++ 4.2b

I have an interesting situation regarding implementation of
a CControlBar derived class called CReBar which, you 
guessed it, implements the MS Rebar control. The problem
is that some Rebar styles conflict with some CControlBar
styles. Specifically:

// REBAR styles from \inetsdk\include\commctrl.h
#define RBS_TOOLTIPS    0x00000100
#define RBS_VARHEIGHT   0x00000200
#define RBS_BANDBORDERS 0x00000400
#define RBS_FIXEDORDER  0x00000800

// ControlBar styles from \msdev\mfc\include\afxres.h
#define CBRS_BORDER_LEFT    0x0100L
#define CBRS_BORDER_TOP     0x0200L
#define CBRS_BORDER_RIGHT   0x0400L
#define CBRS_BORDER_BOTTOM  0x0800L

I have found a limited workaround for this problem
by creating the rebar with the rebar styles but resetting
the CControlBar cached m_dwStyle member to the CBRS 
styles. This makes the CControlBar happy because he
deals with this member variable rather than ::GetWindowLong().

My questions are:

1. Has anyone implemented the Rebar control in
an MFC App using another method?

2. Will MSVC 5.0 contain a "wrapper" for the Rebar
control?


Thanks in advance for any information,
Ron Patton



-----From: Ervin Fried 

Mike Blaszczak wrote:
> 
> At 10:30 1/31/97 -0600, Ronald D. Patton wrote:
> 
> >2. Will MSVC 5.0 contain a "wrapper" for the Rebar
> >control?
> 
> Unfortunately, the rebar control is still implemented by a beta version
> of COMCTL32.DLL, which isn't redistributable.  MFC won't implement
> anything for that control (or any of the other controls in that DLL)
> until the library is freely redistributable.


in the article that introduced the rebar to the 'public'

Rebar: It Isn't Just For Concrete Anymore
by Nancy Winnick Cluts 
November 1996
http://www.microsoft.com/win32dev/ui/rebar.htm

is nowhere specified that the comctl32.dll is beta or that is not
distributable.

at the end of the article it eves says that:
"
Summary 

Now you, too, can have that funky-looking bar at the top of your
application! Just follow my instructions and you shouldn't have any
problems. Go ahead: Cut and paste the code, if you want. That's why I
write this stuff. "



also, one gets this version of comct32.dll with IE3.0x, which is final?
if the dll is beta, shouldn't IE itself be marked as beta?
also, if the comctl32.h and .lib do have support for the latest 
controls, how is one supposed to know that it's beta software?

the ActiveX SDK says that 
"
Note: The Common Controls technology is offered as a preview in this
release of the ActiveX SDK. This documentation presents an early look at
the technology that Microsoft plans to fully implement by the final
release of Internet Explorer 4.0. 
This information is subject to change; Internet Explorer 3.0 supports
only part of this technology. Please refer to your ActiveX SDK
installation of ...\INetSDK\Include\CommCtrl.h to determine which
features of Common Controls are supported with this release.
"

again, nothing about beta or restrictions.


> You probably should consider this fact for your own application
> before you continue pursuing your own application: if you make it
> dependent on the new version of COMCTL32.DLL, you won't be able to
> distribute the proper version of COMCTL32.DLL with your application.
> The beta agreement might even indicate that you're restricted in
> writing such an application.

one can distribute the dll by distributing IE (it's free of charge).
 
> .B ekiM
> http://www.nwlink.com/~mikeblas/
> These words are my own. I do not speak on behalf of Microsoft.
>            This performance was not lip-synched.



Mike Blaszczak -- mikeblas@nwlink.com
Tuesday, February 04, 1997

>-----From: Ervin Fried 

>in the article that introduced the rebar to the 'public'

Actually, the articles that Strohm Armstrong wrote for MSJ
predate Nancy's article by about four months.  They don't
explain that the cntrols are beta, either, and that's an
oversight on the authors part (and on Nancy's part for missing
that fact in her articles).

The MSJ folks put the information in an editorial a month or two
after the articles ran.

The SDK documentation states pretty clearly that the controls are
beta, and explains that they're not redistributable.  They're also
not explicitly listed in the list of things you may redistribute
from the SDK.

>also, one gets this version of comct32.dll with IE3.0x, which is final?

No current version of the library is final.  I'm told that the final
code will be distributed with an upcoming update to the Windows 
operating systems.

>if the dll is beta, shouldn't IE itself be marked as beta?

You'd need to ask the IE team about that.  But they've made it clear
that the controls are a prerelease, and aren't to be redistributed.
Since the controls aren't in their final form, it's probably not a good
idea to play with them--they might change suddenly and break you badly.
If that happens, you have nobody to cry to because you've ignored all
the warnings and advice you've been given.  If you want to budget the
time to retest and rerelease, and want to ship IE3 with your program
just to get the controls installed, I guess you can do so.  But I
don't think it's a good idea, and I explicitly stayed away from making
MFC dependent on the new library for this version of these very reasons.

>also, if the comctl32.h and .lib do have support for the latest 
>controls, how is one supposed to know that it's beta software?

You can learn this by reading the documentation.

>again, nothing about beta or restrictions.

Read the redistribution documentation. Just 'cause you did't find it
doesn't mean it doesn't exist.  The systems guys should have made this
all clearer, but they didn't.  What I'm telling you are real-life facts.

>one can distribute the dll by distributing IE (it's free of charge).

Yep.  But most people don't want to redistribute and install IE just
to redistribute their own application.


.B ekiM
http://www.nwlink.com/~mikeblas/
These words are my own. I do not speak on behalf of Microsoft.
           This performance was not lip-synched.