Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Catching event inside class
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Catching event inside class

 Post Reply Post Reply
Author
Message
terjep View Drop Down
Newbie
Newbie


Joined: 26 August 2011
Location: Norway
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote terjep Quote  Post ReplyReply Direct Link To This Post Topic: Catching event inside class
    Posted: 26 August 2011 at 3:43am
We have a common custom class for the ribbon used by every forms in our application which have (simplified) a Public Function SetupMenu(ByRef theMenu As Object) where theMenu is the CommandBars added to a form.

Inside SetupMenu I have added a new quick access button which I want to take care of the event for inside our custom common class without having to call a class function from the xx_Execute() in every form in the application.

Set Ribbonbar = theMenu.AddRibbonBar("The Ribbon")
Set Control = Ribbonbar.QuickAccessControls.Add(xtpControlButton, ix, "Feedback")

I have tried with Private WithEvents Feedback As CommandBars but doesn't get it to work at all. It works great with keybindings, but this isn't what I need.

Private WithEvents FeedbackKeys As KeyBindings
Set FeedbackKeys = theMenu.KeyBindings

I have tried multiple ways of setting the Feedback but havn't got anyone of them working, either I get type mismatch error or my custom event handler doesn't get called at all.

Any suggestions?
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: 26 August 2011 at 4:32am
Hi,

Also don't see quick solution. 
Think you can only wrap CommandBars to some UserControl and place it to each form instead or should add function call with each CommandBars_Execute.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
terjep View Drop Down
Newbie
Newbie


Joined: 26 August 2011
Location: Norway
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote terjep Quote  Post ReplyReply Direct Link To This Post Posted: 29 August 2011 at 2:49am
To bad :( Anyone else?
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.172 seconds.