Outlook plugin, c++ ATL?

I have maked an outlook plugin for outlook 2013 64 bits using visual studio community 2013. I want to work with attachments from mail when sending mails.
the plugin is not loaded by outlook although LoadBehavior=3 in the registry and if I try to load it in Outlook I get nothing.
so there is the beginning of the header of my class CConnect:

class ATL_NO_VTABLE CConnect :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CConnect, &CLSID_Connect>,
public IDispatchImpl<IConnect, &IID_IConnect, &LIBID_PluginOutlookLib, /*wMajor =*/ 1, /*wMinor =*/ 0>,
public IDispatchImpl<_IDTExtensibility2, &__uuidof(_IDTExtensibility2), &LIBID_AddInDesignerObjects, /* wMajor = */ 1>,
public IDispEventSimpleImpl < 1, CConnect, &__uuidof(Outlook::ItemEvents) >
{
public:
CConnect()
{
};
void __stdcall OnSend(IDispatch * Item, bool Cancel);

BEGIN_SINK_MAP(CConnect)
    SINK_ENTRY_INFO(1,__uuidof(Outlook::ItemEvents),0x0000F005,OnSend,&fiMailItemEvents)
END_SINK_MAP()

DECLARE_REGISTRY_RESOURCEID(IDR_CONNECT)

BEGIN_COM_MAP(CConnect)
    COM_INTERFACE_ENTRY(IConnect)
    COM_INTERFACE_ENTRY(_IDTExtensibility2)
END_COM_MAP()

there is an entry in the registry for the plugin

first question:If someone has a good idea to solve this problem…(to load successfully the plugin in outlook)

(if an attachment have a size bigger than msize I want to save it with SaveAsFile() and to proccess it).

second question : what are the arguments of Attachment::SaveAsFile() I didn’t found them in the documentation and is there any method Attachment::size() ?

bests regards.


Source: c++

Leave a Reply