Solved

Button in CDilogBar

Posted on 1998-08-06
3
243 Views
Last Modified: 2010-04-02
Hi experts.
I'm developing my app using VC++5.0 in WindowsNT4.0 SP3.
I installed a button control in a CDialogBar with associated handler.
But the button isn't enabled during runtime.
Can anyone let me know why and how to enable it ?
Thanks in advance.
0
Comment
Question by:okg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Expert Comment

by:arun_ta
ID: 1169519
Try the following steps:

1.In resource editor, take the dialog bar and set
  Style = Child, Border = None, Visible = unchecked.

2.Declare the object as : CDialogBar myDlgBar;

3.Add dialogbar object creation code in appropriate member function.
eg. in OnCreate() of CMainFrame class as: myDlgBar.Create(this,IDD_MY_BAR,CBRS_TOP,ID_MY_BAR);

Note: ID_MY_BAR is the dialogbar's control window ID, which should be in the range 0xE800 - 0xE820.  


   
0
 

Author Comment

by:okg
ID: 1169520
Dear arun_ta
Thanks.
But it doesn't help.
0
 

Accepted Solution

by:
TangCheng earned 100 total points
ID: 1169521
You must add WM_COMMAND message for this button in your App or View or Document's class.
You can see the button same as normal menu message.
When you push the button, the WM_COMMAND message will be active.

eg.
The Button ID is IDB_BUTTON1

BEGIN_MESSAGE_MAP(CMyApp, CWinApp)
..
ON_COMMAND(IDB_BUTTON1,OnButton1) //Add This Line by yourself
END_MESSAGE_MAP()

void CMyApp::OnButton1()
{
    ..... //Add your code.
}
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

707 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