Solved

Creating Toolbar Wrapper Class

Posted on 1997-07-29
2
511 Views
Last Modified: 2013-11-20
I was reading a great article on the MSDN cd's about the new toolbar. And I decided to
create my own wrapper class around it.

The interface to this CWnd derived class would be something like

Create
SetImageList
SetDisabledImageList
SetHotImageList
AddButton
DelButton
SetButton
.
.


First of all, the only way I succeeded in creating a toolbar with buttons, was using the
api(?):

      CreateToolbarEx

Which takes bitmap/buttons as argument - not as flexible as I would like.


So my question is this:

Having a handle to a toolbar, created with CWnd()->Create(...), is it possible to add
buttons dynamically?
How is this done? What sort of initializing should be done??? A small piece of code would be
great, but not essential...

0
Comment
Question by:mtoft
2 Comments
 
LVL 4

Accepted Solution

by:
mbhakta earned 50 total points
Comment Utility
Why are you taking all this trouble ?

CToolBarCtrl is the MFC wrapper for the new Win32 Toolbar. It covers all the things you would need to create a toolbar. You can derive your wrapper class from the CToolBarCtrl if you want something more. In the CToolbarCtrl there is a method called AddButtons() which allows you to add buttons dynamically.
0
 
LVL 2

Author Comment

by:mtoft
Comment Utility
Sorry about the delay...
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to determine file rename from EventLog ? 2 36
sameEnds challenge 3 105
MaxSpan challenge 9 65
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 45
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

18 Experts available now in Live!

Get 1:1 Help Now