Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I am working on outlook addin

I am having following calls which calls when New mail comes and if user sents mail.

void __stdcall OnNewMail();
void __stdcall OnSend(IDispatch * item, bool cancel);

BEGIN_SINK_MAP(CAddin)
SINK_ENTRY_INFO(1,__uuidof(Outlook::ApplicationEvents),/*dispinterface*/0x0000F002,OnSend,&OnSendInfo)
SINK_ENTRY_INFO(2,__uuidof(Outlook::ApplicationEvents),/*dispinterface*/0x0000F003,OnNewMail,&OnNewMailInfo)
END_SINK_MAP()

which works fine.

now i want same ( IDispatch * item ) in case of NewMail notification handler.

if i put as like this:

_ATL_FUNC_INFO OnNewMailInfo = {CC_STDCALL, VT_EMPTY, 0, { VT_DISPATCH | VT_BOOL }};
void __stdcall OnNewMail(IDispatch * item, bool cancel);

i am getting IDispatch NULL pointer also it crashes once it goes out of OnNewMail Function.


Please suggest where i am going wrong.

your revert is welcome.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900