how to handle ItemEvents?

A

Alexander Chen

I want to handle ItemEvents of the _MailItem object. users can create many
_MailItem objects through creating new mail,so the following code will not
work:


class ATL_NO_VTABLE CAddin :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CAddin, &CLSID_Addin>,
public ISupportErrorInfo,
public IDispatchImpl<IAddin, &IID_IAddin, &LIBID_HWOLADDINLib>,
public IDispatchImpl<_IDTExtensibility2, &IID__IDTExtensibility2,
&LIBID_AddInDesignerObjects>,
public IDispEventSimpleImpl<1,CAddin, &__uuidof(Outlook::_ItemsEvents)>
{
......
}

It can only catch the ItemEvents of the first inspector.
 

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