Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   com addin button callbacks. (http://www.outlookbanter.com/add-ins-outlook/41644-com-addin-button-callbacks.html)

Daniel February 22nd 07 03:27 PM

com addin button callbacks.
 

I'm building an Outlook COM addin with C++. I've implemented a command bar
and button call back functions similarly to how things were explained in the
article http://www.codeproject.com/com/outlookaddin.asp. The command bar and
buttons live on the appointment item in outlook. I find that when two
appointment items are opened, and I click on the button in one, the call
back is fired in both. Any ideas? Thankyou.

Some pseudocode below

..h

//Appointment toolbar button events
extern _ATL_FUNC_INFO OnButtonClick;

typedef IDispEventSimpleImpl 4,CAppointmentAddin,
&__uuidof(Office::_CommandBarButtonEvents) ApptButton1Events;


class ATL_NO_VTABLE CAppointmentAddin :
public CComObjectRootEx
,public ISupportErrorInfo
,public IDispatchImpl
,public IInspectorEvents
,public IItemEvents
,public
IDispEventSimpleImpl4,CAppointmentAddin,&__uuidof (Office::_CommandBarButtonEvents)
//,public
IDispEventSimpleImpl5,CAppointmentAddin,&__uuidof (Office::_CommandBarButtonEvents)
,public IApptCommandBarsEvents
{

BEGIN_SINK_MAP(CAppointmentAddin)

SINK_ENTRY_INFO(4,
__uuidof(Office::_CommandBarButtonEvents),
0x01,
OnButtonClick,
&OnButtonClickInfo)
END_SINK_MAP


}



Dan G February 22nd 07 08:17 PM

com addin button callbacks.
 
Never mind. A few posts down from this was the answer. Needed unique tags
for my buttons.


"Daniel" wrote:


I'm building an Outlook COM addin with C++. I've implemented a command bar
and button call back functions similarly to how things were explained in the
article http://www.codeproject.com/com/outlookaddin.asp. The command bar and
buttons live on the appointment item in outlook. I find that when two
appointment items are opened, and I click on the button in one, the call
back is fired in both. Any ideas? Thankyou.

Some pseudocode below

..h

//Appointment toolbar button events
extern _ATL_FUNC_INFO OnButtonClick;

typedef IDispEventSimpleImpl 4,CAppointmentAddin,
&__uuidof(Office::_CommandBarButtonEvents) ApptButton1Events;


class ATL_NO_VTABLE CAppointmentAddin :
public CComObjectRootEx
,public ISupportErrorInfo
,public IDispatchImpl
,public IInspectorEvents
,public IItemEvents
,public
IDispEventSimpleImpl4,CAppointmentAddin,&__uuidof (Office::_CommandBarButtonEvents)
//,public
IDispEventSimpleImpl5,CAppointmentAddin,&__uuidof (Office::_CommandBarButtonEvents)
,public IApptCommandBarsEvents
{

BEGIN_SINK_MAP(CAppointmentAddin)

SINK_ENTRY_INFO(4,
__uuidof(Office::_CommandBarButtonEvents),
0x01,
OnButtonClick,
&OnButtonClickInfo)
END_SINK_MAP


}





All times are GMT +1. The time now is 12:28 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com