[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Creating Toolbar Wrapper Class

Posted on 1997-07-29
2
Medium Priority
?
578 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 100 total points
ID: 1302894
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
ID: 1302895
Sorry about the delay...
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

867 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