Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Toolbar icons do not appear!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Toolbar icons do not appear!

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Toolbar icons do not appear!
    Posted: 16 January 2008 at 9:50am

In my CMainFrame-window I have multiple toolbars. They look OK.

Note that in this project CFrameWnd-windows are used frequently, but without associated document templates (and frames).
 
I have a CXTPFrameWnd-derived window, CMyFrame, as a member in one of the views (don't blame me ;). These calls are done in CMyFrame::OnCreate():
 
InitCommandBars();
CXTPToolBar *pToolbar = (CXTPToolBar*)GetCommandBars()->Add("My tool", xtpBarTop);
pToolBar->LoadToolBar(IDR_TOOL);
XTPImageManager()->SetIcons(IDR_TOOL, IDB_TOOL;
 
The problem is that the icons from IDB_TOOL are not shown! What could be the reason for this? Please help me out on this one.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 16 January 2008 at 11:11am
Hi,
What do you have in resources for IDR_TOOL and IDB_TOOL ? Check How many icons you have in IDR_TOOL  and what size of IDB_TOOL bitmap.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 17 January 2008 at 3:34am

It turned out that IDR_TOOL had a bitmap resource with no icons. Still, I think this is weird:

IDR_TOOL points to "tool.bmp" (contains a gray bitmap)
IDB_TOOL points to "tool_hicolor.bmp" (contains the icons)
 
LoadToolBar(IDR_TOOL)
SetIcons(IDR_TOOL, IDB_TOOL) // This does not overwrite the previous icons!
 
I solved it by remapping IDR_TOOL to "tool_hicolor.bmp" and removing the call to SetIcons. Why did I have to do that?
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.