CommandBar button events

S

Stee

Hi,
I am creating a Menu and a toolbar button which will do
exactly same thing. To capture this event in my add-in,
should I create two events like below? Is it not possible
to have one event getting fired for both the menu and
toolbar clicks? Any suggestions?

typedef IDispEventSimpleImpl</*nID =*/ 3,CAddin, &__uuidof
(Office::_CommandBarButtonEvents)> CommandMenuEvents;

typedef IDispEventSimpleImpl</*nID =*/ 2,CAddin, &__uuidof
(Office::_CommandBarButtonEvents)> CommandButton2Events;

.....

SINK_ENTRY_INFO(2, __uuidof
(Office::_CommandBarButtonEvents),/*dispid*/ 0x01,
OnClickButton, &OnClickButtonInfo)
SINK_ENTRY_INFO(3, __uuidof
(Office::_CommandBarButtonEvents),/*dispid*/ 0x01,
OnClickMenu, &OnClickButtonInfo)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top