Click here to Skip to main content
15,923,218 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Michael Dunn29-Jul-03 16:57
sitebuilderMichael Dunn29-Jul-03 16:57 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Tom Archer29-Jul-03 18:23
Tom Archer29-Jul-03 18:23 
GeneralRe: Subclassing CListCtrl in a CListView Pin
Tom Archer30-Jul-03 9:45
Tom Archer30-Jul-03 9:45 
GeneralVC++6 ide question Pin
Beer2629-Jul-03 6:57
Beer2629-Jul-03 6:57 
GeneralRe: VC++6 ide question Pin
David Crow29-Jul-03 7:25
David Crow29-Jul-03 7:25 
GeneralRe: VC++6 ide question Pin
Beer2629-Jul-03 8:43
Beer2629-Jul-03 8:43 
GeneralRe: VC++6 ide question Pin
Mike Dimmick29-Jul-03 13:29
Mike Dimmick29-Jul-03 13:29 
GeneralToolBar text with BTNS_SHOWTEXT Pin
armentage29-Jul-03 6:55
armentage29-Jul-03 6:55 
I'm trying to put text into an MFC CToolBar, and am having problems with end of my tool bar getting cut off. What's happening is that app is computing the size of the toolbar WITHOUT the text, just the width of the icons/separators, so the toolbar ends up too narrow.

I'm using Visual Studio 6.0 SP5, with IE6.0 installed on my system. Here's the code I am using:

<br />
DWORD dwExStyle = TBSTYLE_EX_DRAWDDARROWS|TBSTYLE_EX_MIXEDBUTTONS ;<br />
tbar.GetToolBarCtrl().SendMessage(TB_SETEXTENDEDSTYLE, 0, dwExStyle);<br />
<br />
int index = CommandToIndex(IDM_CALCULATE);<br />
WORD dwStyle = tbar.GetButtonStyle(index);<br />
dwStyle |= BTNS_SHOWTEXT|BTNS_AUTOSIZE;        <br />
tbar.SetButtonStyle(index, dwStyle);<br />
tbar.SetButtonText(index, "Calculate");    


Some info: BTNS_SHOWTEXT is NOT defined by the MFC/Win32 header files that are installed on my system. I had #define BTNS_SHOWTEXT 0x40 to get this to work. I found many references to it on MSDN, and google'd for its value. I understand it will only work on systems that have IE5.0 or better.

What I'm guessing is that the MFC CToolBar implements the CalcSize function using assumptions about IE4.0; rather than calling CToolBarCtrl::GetItemRect, its assuming the size of each icon by using its bitmap size + padding. The BTNS_SHOWTEXT option is new and the circa 1998 (IE4 was just released) MFC just doesn't know to deal with it.

Thing is, I can't find any threads or discussions on what to do in this situation. I can't find a place to download a set of Win32 headers that match the new ComCtl32.dll v5.8, or any sort of MFC patches to expore the v5.8 functionality to VC6.0

Any help would be greatly appreciate. I can't switch to VC.NET (as much as I'd love to) because my company likes to drag it's feet when it comes to upgrading development tools.
GeneralRe: ToolBar text with BTNS_SHOWTEXT Pin
Michael Dunn29-Jul-03 17:01
sitebuilderMichael Dunn29-Jul-03 17:01 
GeneralRe: ToolBar text with BTNS_SHOWTEXT Pin
armentage30-Jul-03 3:06
armentage30-Jul-03 3:06 
Generalread and write MS Office file in Visual C++ Pin
Jason Truong29-Jul-03 6:20
Jason Truong29-Jul-03 6:20 
GeneralRe: read and write MS Office file in Visual C++ Pin
David Crow29-Jul-03 7:26
David Crow29-Jul-03 7:26 
GeneralRe: read and write MS Office file in Visual C++ Pin
Jason Truong31-Jul-03 4:19
Jason Truong31-Jul-03 4:19 
GeneralRe: read and write MS Office file in Visual C++ Pin
David Crow31-Jul-03 4:40
David Crow31-Jul-03 4:40 
GeneralVisual C++ Resource Editor Pin
Anonymous29-Jul-03 5:39
Anonymous29-Jul-03 5:39 
GeneralRe: Visual C++ Resource Editor Pin
keegan29-Jul-03 5:48
keegan29-Jul-03 5:48 
GeneralRe: Visual C++ Resource Editor Pin
Anonymous29-Jul-03 6:13
Anonymous29-Jul-03 6:13 
GeneralRe: Visual C++ Resource Editor Pin
Maximilien29-Jul-03 7:07
Maximilien29-Jul-03 7:07 
GeneralRe: Visual C++ Resource Editor Pin
idir29-Jul-03 7:26
idir29-Jul-03 7:26 
GeneralRe: Visual C++ Resource Editor Pin
Maximilien29-Jul-03 8:16
Maximilien29-Jul-03 8:16 
GeneralLinking to a spot in source code Pin
keegan29-Jul-03 5:34
keegan29-Jul-03 5:34 
GeneralRe: Linking to a spot in source code Pin
Ian Darling29-Jul-03 5:38
Ian Darling29-Jul-03 5:38 
GeneralRe: Linking to a spot in source code Pin
keegan29-Jul-03 5:49
keegan29-Jul-03 5:49 
GeneralRe: Linking to a spot in source code Pin
Neville Franks29-Jul-03 5:56
Neville Franks29-Jul-03 5:56 
GeneralCStringArray in a CList Pin
Anonymous29-Jul-03 4:13
Anonymous29-Jul-03 4:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.