Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / February 2007

Tip: Looking for answers? Try searching our database.

com addin button callbacks.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daniel - 22 Feb 2007 15:27 GMT
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
IDispEventSimpleImpl<4,CAppointmentAddin,&__uuidof(Office::_CommandBarButtonEvents)>
//,public
IDispEventSimpleImpl<5,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 - 22 Feb 2007 20:17 GMT
Never mind.  A few posts down from this was the answer.  Needed unique tags
for my buttons.  

> 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
[quoted text clipped - 36 lines]
>
> }
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.