Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CReBar and ActiveX Control

Posted on 2003-11-20
5
Medium Priority
?
340 Views
Last Modified: 2013-11-20
Hi Guru's/Saints/Gods


I am using CReBar with a toolbar on it in my activex control. The problem is all the buttons are disabled on the toolbar. I think this could be because activex controls don't have message loop. I am sending WM_COMMAND message for the toolbar buttons from my main control and this enables buttons if I only use the toolbar on its OWN, however when I embed this toolbar inside a Rebar the buttons are grayed out....

please throw some light on this....I wonder what causes the buttons to get enabled when they are part of a rebar???

Many Thanks
0
Comment
Question by:devmentee
[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
  • 4
5 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9786498
Suppose m_wndToolbarCtrl is your CToolbarCtrl object

call

m_wndToolbarCtrl.EnableButton(nBuutonID, TRUE);

Good luck
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9786509
>> think this could be because activex controls don't have message loop
Thats correct

Rosh :)
0
 

Author Comment

by:devmentee
ID: 9786579
Hi roshmon

I tried the following line where m_ToolBar is of type CToolBar...which compiles but I get the same result. ie my button is not enabled...
      m_ToolBar.GetToolBarCtrl().EnableButton(ID_MY_BUTTON, TRUE);

I then do  m_wndReBar.AddBar ( &m_ToolBar ) ;

Also let's say once I enable a button is there any handler which I have to implement to enable/disable buttons like you would ON_UPDATE_COMMAND_UI for a normal toolbar??


0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9786700
>> like you would ON_UPDATE_COMMAND_UI for a normal toolbar??

Ohh Yes

Call Like this


void CMainFrame::OnUpdateMyButton(CCmdUI* pCmdUI)
{
      pCmdUI->Enable(TRUE);

}

This can be a variable that control the enable/disable

pCmdUI->Enable(m_EnableDiable);


Rosh :)
0
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 800 total points
ID: 9786704
Use the MACRO ON_UPDATE_COMMAND_UI_RANGE for a range of buttons
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

598 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